mirror of
https://github.com/slynn1324/tinypin
synced 2026-05-03 09:30:32 +00:00
rotation fix
This commit is contained in:
@@ -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