Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resizing for images with EXIF orientation #2468

Merged
merged 2 commits into from
Apr 3, 2024
Merged

Fix resizing for images with EXIF orientation #2468

merged 2 commits into from
Apr 3, 2024

Conversation

amtanq
Copy link
Contributor

@amtanq amtanq commented Mar 31, 2024

Fixes #2445

Previous Behavior

$ identify test.png
test.png PNG 300x380 300x380+0+0 8-bit sRGB 123430B 0.000u 0:00.000

$ identify -format '%[orientation]' static/photos/testExif.jpeg
RightTop

# resize_image(..., width=300, height=100)

$ identify test.2b662a94d62c950e.png
test.2b662a94d62c950e.png PNG 100x300 100x300+0+0 8-bit sRGB 65706B 0.000u 0:00.000

$ identify -format '%[orientation]' test.2b662a94d62c950e.png
Undefined

New Behavior

$ identify test.png
test.png PNG 300x380 300x380+0+0 8-bit sRGB 123430B 0.000u 0:00.000

$ identify -format '%[orientation]' static/photos/testExif.jpeg
RightTop

# resize_image(..., width=300, height=100)

$ identify test.2b662a94d62c950e.png
test.2b662a94d62c950e.png PNG 300x100 300x100+0+0 8-bit sRGB 65706B 0.000u 0:00.000

$ identify -format '%[orientation]' test.2b662a94d62c950e.png
Undefined

Let me know if you have any remarks.

@Keats
Copy link
Collaborator

Keats commented Apr 1, 2024

Is it hard to add a test for it?

@amtanq
Copy link
Contributor Author

amtanq commented Apr 1, 2024

Is it hard to add a test for it?

Thanks for the suggestion, have added test for the change

@Keats Keats merged commit 866eb0c into getzola:next Apr 3, 2024
5 checks passed
@Keats
Copy link
Collaborator

Keats commented Apr 3, 2024

Thanks!

veluca93 pushed a commit to veluca93/zola that referenced this pull request May 14, 2024
* Fix resizing for images with EXIF orientation

* Added test for asymmetric resize for exif images

---------

Co-authored-by: Tanishq <[email protected]>
Keats pushed a commit that referenced this pull request Jun 20, 2024
* Fix resizing for images with EXIF orientation

* Added test for asymmetric resize for exif images

---------

Co-authored-by: Tanishq <[email protected]>
berdandy pushed a commit to berdandy/azola that referenced this pull request Sep 17, 2024
* Fix resizing for images with EXIF orientation

* Added test for asymmetric resize for exif images

---------

Co-authored-by: Tanishq <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants