Merge branch 'patch-3' of https://github.com/camjac251/lolisafe into camjac251-patch-3

This commit is contained in:
Bobby Wibowo 2020-06-06 19:34:46 +07:00
commit 46c84db64f
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
2 changed files with 6 additions and 5 deletions

View File

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

View File

@ -28,7 +28,7 @@ const self = {
imageExts: ['.gif', '.jpeg', '.jpg', '.png', '.svg', '.tif', '.tiff', '.webp'],
videoExts: ['.3g2', '.3gp', '.asf', '.avchd', '.avi', '.divx', '.evo', '.flv', '.h264', '.h265', '.hevc', '.m2p', '.m2ts', '.m4v', '.mk3d', '.mkv', '.mov', '.mp4', '.mpeg', '.mpg', '.mxf', '.ogg', '.ogv', '.ps', '.qt', '.rmvb', '.ts', '.vob', '.webm', '.wmv'],
thumbSize: config.uploads.generateThumbs.size || 200,
ffprobe: promisify(ffmpeg.ffprobe),
albumsCache: {},
@ -219,8 +219,8 @@ self.generateThumbs = async (name, extname, force) => {
// If image extension
if (self.imageExts.includes(extname)) {
const resizeOptions = {
width: 200,
height: 200,
width: ${self.thumbSize},
height: ${self.thumbSize},
fit: 'contain',
background: {
r: 0,
@ -270,7 +270,7 @@ self.generateThumbs = async (name, extname, force) => {
},
{
filter: 'scale',
options: '200:200:force_original_aspect_ratio=decrease'
options: `${self.thumbSize}:${self.thumbSize}:force_original_aspect_ratio=decrease`
}
])
.output(thumbname)