mirror of
https://github.com/slynn1324/tinypin.git
synced 2026-01-23 02:25:08 +00:00
rotation fix
This commit is contained in:
parent
443821f345
commit
03c95fbada
1 changed files with 2 additions and 1 deletions
|
|
@ -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' });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue