Why does the image get rotated while creating a screenshot using sharp?

27 Views Asked by At

I am trying to generate a thumbnail from a few original images. To achieve that, I'm using this package: sharp. Everytime I try to do that, the created thumbnails are getting rotated automatically.

This is the piece of code to generate thumbnails:

const thumbnailBuffer = await sharp(fileBuffer).resize(thumbnailWidth).toBuffer();

I am not sure if it's the thumbnailWidth that's affecting the process. Any help will be greatly appreciated. Thanks in advance!

0

There are 0 best solutions below