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

Reverse width and height for images rotated 90 degrees #36

Open
peterwilsoncc opened this issue Oct 29, 2018 · 0 comments
Open

Reverse width and height for images rotated 90 degrees #36

peterwilsoncc opened this issue Oct 29, 2018 · 0 comments

Comments

@peterwilsoncc
Copy link
Contributor

WordPress does not modify images containing an EXIF orientation (eg from an iPhone), this causes the width and height to be recorded in the meta data incorrectly for images rotated 90 degrees.

When processing images, the sharp library does rotate images containing an EXIF orientation.

This can lead to an incorrect crop via Tachyon as the Tachyon Plugin sets the arguments to fit={height},{width}.

To crop the image correctly, the meta data's width and height need to be reversed for images rotated 90 degrees.

See peterwilsoncc/doitlive.peterwilson.cc#73 for a sample filter on the hook wp_get_attachment_metadata.

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

No branches or pull requests

1 participant