mirror of
https://github.com/slynn1324/tinypin
synced 2026-11-16 02:16:35 +00:00
rotation fix
This commit is contained in:
1 parent
443821f345
commit
03c95fbada
1 file changed
+2
-1
@@ -25,7 +25,8 @@ async function downloadImage(imageUrl){
|
||||
|
||||
async function processImage(buffer){
|
||||
let original = sharp(buffer);
|
||||
let originalBuffer = await original.toFormat("jpg").toBuffer();
|
||||
// add rotate to auto-rotate based on metadata, and withMetadata to preserve the original metadata
|
||||
let originalBuffer = await original.toFormat("jpg").rotate().withMetadata().toBuffer();
|
||||
let originalMetadata = await original.metadata();
|
||||
|
||||
let thumbnail = await original.resize({ width: THUMBNAIL_IMAGE_SIZE, height: THUMBNAIL_IMAGE_SIZE, fit: 'inside' });
|
||||
|
||||
Reference in new issue
Block a user