mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-31 07:11:33 +00:00
add user config option for thumbnail size
This commit is contained in:
parent
de70b93cc6
commit
776414814d
@ -418,7 +418,8 @@ module.exports = {
|
|||||||
generateThumbs: {
|
generateThumbs: {
|
||||||
image: true,
|
image: true,
|
||||||
video: false,
|
video: false,
|
||||||
placeholder: null
|
placeholder: null,
|
||||||
|
size: 200
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -222,8 +222,8 @@ self.generateThumbs = async (name, extname, force) => {
|
|||||||
// If image extension
|
// If image extension
|
||||||
if (self.imageExts.includes(extname)) {
|
if (self.imageExts.includes(extname)) {
|
||||||
const resizeOptions = {
|
const resizeOptions = {
|
||||||
width: 200,
|
width: ${config.uploads.generateThumbs.size},
|
||||||
height: 200,
|
height: ${config.uploads.generateThumbs.size},
|
||||||
fit: 'contain',
|
fit: 'contain',
|
||||||
background: {
|
background: {
|
||||||
r: 0,
|
r: 0,
|
||||||
@ -270,7 +270,7 @@ self.generateThumbs = async (name, extname, force) => {
|
|||||||
.outputOptions([
|
.outputOptions([
|
||||||
`-ss ${duration * 20 / 100}`,
|
`-ss ${duration * 20 / 100}`,
|
||||||
'-vframes 1',
|
'-vframes 1',
|
||||||
'-vf scale=600:600:force_original_aspect_ratio=decrease'
|
`-vf scale=${config.uploads.generateThumbs.size}:${config.uploads.generateThumbs.size}:force_original_aspect_ratio=decrease`
|
||||||
])
|
])
|
||||||
.on('error', async error => {
|
.on('error', async error => {
|
||||||
// Try to unlink thumbnail,
|
// Try to unlink thumbnail,
|
||||||
|
Loading…
Reference in New Issue
Block a user