incubator-pagespeed-mod icon indicating copy to clipboard operation
incubator-pagespeed-mod copied to clipboard

Exif image orientation should be handled when stripping image metadata

Open 5im-0n opened this issue 7 years ago • 7 comments

When using mod_pagespeed to optimize images, the exif orientation data is not taken into account, and exif data is stripped, so the image rotation is wrong when reaching the browser. mod_pagespeed should read exif orientation data, and eventually rotate the image before optimizing it.

5im-0n avatar Mar 07 '18 09:03 5im-0n

Thanks for the report. Note that it is possible to disable the meta data stripping, maybe that helps in the short term: https://www.modpagespeed.com/doc/reference-image-optimize#strip_image_meta_data

oschaaf avatar Mar 07 '18 09:03 oschaaf

thank you @oschaaf, I didn't know that. still, having the image optimized and resized, while retaining the correct orientation would be very nice.

5im-0n avatar Mar 07 '18 09:03 5im-0n

By disabling meta data stripping I was suggesting you could achieve resizing and most optimizations on offer (only excluding the meta data stripping), and keep the orientation correct as it will be around post-optimization in the exif data — or at least I hope so.

oschaaf avatar Mar 07 '18 10:03 oschaaf

Yes it works. Metadata is retained and the css property image-orientation: from-image; works (in browsers that support it).

example: https://fcku.it/it.comp.console/thread/3694261

5im-0n avatar Mar 07 '18 10:03 5im-0n

Cool, thanks for sharing that.

Let’s keep this issue open, to see if we can automagically make this work at some point.

oschaaf avatar Mar 07 '18 10:03 oschaaf

Is there any update on this issue? We have WordPress sites that would benefit from the whole resize_images module but image rotation should should be applied to the image based on the exif data.

sjaks avatar Oct 06 '20 07:10 sjaks

As far as I know no, no news about this. But you can diable strip images metadata with: Nginx pagespeed DisableFilters strip_images_meta_data Apache ModPagespeedDisableFilters strip_image_meta_data

Lofesa avatar Oct 06 '20 09:10 Lofesa