You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm uploading files to my server, where Sharp is used for rotating and croping thumbnails. If the upload comes from an iPhone where the following criteria is met, the jpeg gives me rotation trouble.
Photo from camera or album
Photo in portrait mode
Landscape photos works fine. These seems to be represented by real pixels, i.e. w,h = actual pixels.
Portrait photos has w,h as if it was a landscape image.
Orientation = 6, i.e. "image needs to be rotated 90 degrees".
My question:
Should I manually rotate the image before attempting other operations?
Or should Sharp handle this automatically?
I'm asking because I don't want to implement the manual rotation if this is implemented in Sharp later on.
Please see the attached jpeg file and the below metadata from this file.
Thanks for the information. I'm now rotating manually and it works great.
The odd thing about stated pixels and actual pixels might be worth mentioning in the docs. In my case I discovered the problem due to "bad extract area". I tried to crop the file based on the stated pixels, i.e. landscape. In practice the image was portrait and my crop went outside of the image area. It took a while to understand this, because iPhone only seems to create this discrepancy on portrait images, not landscape.
It would also be useful with some more info in the docs about EXIF orientation numbers. It's easy to find, but it would have saved me some hedache because I initially thought that orientation was the same as rotation, i.e. 6 degrees. But 6 means "rotate 90".
I'm uploading files to my server, where Sharp is used for rotating and croping thumbnails. If the upload comes from an iPhone where the following criteria is met, the jpeg gives me rotation trouble.
Landscape photos works fine. These seems to be represented by real pixels, i.e. w,h = actual pixels.
Portrait photos has w,h as if it was a landscape image.
Orientation = 6, i.e. "image needs to be rotated 90 degrees".
My question:
I'm asking because I don't want to implement the manual rotation if this is implemented in Sharp later on.
Please see the attached jpeg file and the below
metadata
from this file.The text was updated successfully, but these errors were encountered: