add user config option for thumbnail size

This commit is contained in:
camjac251 2020-06-01 04:17:23 -05:00
parent de70b93cc6
commit 776414814d
2 changed files with 5 additions and 4 deletions

View File

@ -418,7 +418,8 @@ module.exports = {
generateThumbs: {
image: true,
video: false,
placeholder: null
placeholder: null,
size: 200
},
/*

View File

@ -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,