1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

CLI: Improved: Update sharp (for node 12 compatibility) (#1471)

This commit is contained in:
Christian Moritz
2019-04-30 18:32:51 +02:00
committed by Laurent Cozic
parent 01f2759a62
commit 788dc42684
3 changed files with 78 additions and 48 deletions

View File

@ -87,9 +87,10 @@ function shimInit() {
return new Promise((resolve, reject) => {
sharp(filePath)
.resize(Resource.IMAGE_MAX_DIMENSION, Resource.IMAGE_MAX_DIMENSION)
.max()
.withoutEnlargement()
.resize(Resource.IMAGE_MAX_DIMENSION, Resource.IMAGE_MAX_DIMENSION, {
fit: 'inside',
withoutEnlargement: true,
})
.toFile(targetPath, (err, info) => {
if (err) {
reject(err);