incubator-pagespeed-mod
incubator-pagespeed-mod copied to clipboard
Exif image orientation should be handled when stripping image metadata
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.
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
thank you @oschaaf, I didn't know that. still, having the image optimized and resized, while retaining the correct orientation would be very nice.
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.
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
Cool, thanks for sharing that.
Let’s keep this issue open, to see if we can automagically make this work at some point.
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.
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