1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

Merge pull request #558 from sam365724/patch-1

Change from jpg to more efficient webp thumbnails
This commit is contained in:
Patrik J. Braun 2022-11-21 22:12:44 +01:00 committed by GitHub
commit 70d1a04e1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -121,7 +121,7 @@ export class PhotoProcessing {
return path.join( return path.join(
ProjectPath.TranscodedFolder, ProjectPath.TranscodedFolder,
ProjectPath.getRelativePathToImages(path.dirname(mediaPath)), ProjectPath.getRelativePathToImages(path.dirname(mediaPath)),
file + '_' + size + '.jpg' file + '_' + size + '.webp'
); );
} }
@ -146,7 +146,7 @@ export class PhotoProcessing {
.digest('hex') + .digest('hex') +
'_' + '_' +
size + size +
'.jpg' '.webp'
); );
} }

View File

@ -161,7 +161,7 @@ export class ImageRendererFactory {
fit: 'cover', fit: 'cover',
}); });
} }
await image.withMetadata().jpeg().toFile(input.outPath); await image.withMetadata().webp({effort: 6, quality: 60}).toFile(input.outPath);
}; };
} }
} }