mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-18 17:21: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: {
|
||||
image: true,
|
||||
video: false,
|
||||
placeholder: null
|
||||
placeholder: null,
|
||||
size: 200
|
||||
},
|
||||
|
||||
/*
|
||||
|
@ -222,8 +222,8 @@ self.generateThumbs = async (name, extname, force) => {
|
||||
// If image extension
|
||||
if (self.imageExts.includes(extname)) {
|
||||
const resizeOptions = {
|
||||
width: 200,
|
||||
height: 200,
|
||||
width: ${config.uploads.generateThumbs.size},
|
||||
height: ${config.uploads.generateThumbs.size},
|
||||
fit: 'contain',
|
||||
background: {
|
||||
r: 0,
|
||||
@ -270,7 +270,7 @@ self.generateThumbs = async (name, extname, force) => {
|
||||
.outputOptions([
|
||||
`-ss ${duration * 20 / 100}`,
|
||||
'-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 => {
|
||||
// Try to unlink thumbnail,
|
||||
|
Loading…
Reference in New Issue
Block a user