tachyon-plugin icon indicating copy to clipboard operation
tachyon-plugin copied to clipboard

Reverse width and height for images rotated 90 degrees

Open peterwilsoncc opened this issue 7 years ago • 0 comments

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.

peterwilsoncc avatar Oct 29 '18 21:10 peterwilsoncc