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
Expected behavior
The image orientation should remain consistent with the original, even after resizing.
Environment:
@vendure/core version: v3.0.3
Nodejs: v20.11
Database: postgres
Additional context
This issue affects only source images. Previews have EXIF data applied during generation and are saved with the correct orientation. The browser handles EXIF rotation during rendering for source images, but resizing removed this data, causing incorrect orientation.
It looks like the issue is happening in this part of the code. The logic there doesn’t seem to account for the EXIF orientation when resizing source images.
Describe the bug
Some images appear rotated because EXIF Orientation data is lost during the resize on fly process for source images.
To Reproduce
/cr2.jpeg?mode=crop&w=640&h=640&q=85
).Source: https://api.pinelab.studio/assets/source/35/cr2.jpeg
Source with resize query: https://api.pinelab.studio/assets/source/35/cr2.jpeg?mode=crop&w=640&h=640&q=85
Expected behavior
The image orientation should remain consistent with the original, even after resizing.
Environment:
Additional context
This issue affects only source images. Previews have EXIF data applied during generation and are saved with the correct orientation. The browser handles EXIF rotation during rendering for source images, but resizing removed this data, causing incorrect orientation.
A similar problem with preview images was solved by adding sharp.rotate(). You can see the details in Sharp should use EXIF image orientation #1548.
It looks like the issue is happening in this part of the code. The logic there doesn’t seem to account for the EXIF orientation when resizing source images.
vendure/packages/asset-server-plugin/src/transform-image.ts
Lines 42 to 63 in 42e4b0f
The text was updated successfully, but these errors were encountered: