GNOME Bugzilla – Bug 778925
Exported and shared items have their orientation applied twice
Last modified: 2017-02-20 06:58:51 UTC
Items with an orientation tag have their orientation applied twice when exported or shared. Bug 734844 has examples of such images. Since we already apply the embedded orientation when loading the item, we need to neutralize it from the metadata when exporting and sharing. Otherwise, the orientation will be applied twice when the resulting image is decoded by another program.
Created attachment 346204 [details] [review] base-item: Fix the orientation of exported and shared items
Created attachment 346205 [details] An image with exif orientation as flipped The values of exif orientation tag are mentioned [1]. Also [2] might be helpful. [1] https://github.com/GNOME/gexiv2/blob/master/gexiv2/gexiv2-metadata.h#L51 [2] http://jpegclub.org/exif_orientation.html
Review of attachment 346204 [details] [review]: It works as expected but "neutralizing" in real terms means to replace with same old initial value. The attached image has orientation tag as GEXIV2_ORIENTATION_HFLIP, but while exporting it's being "neutralized" by GEXIV2_ORIENTATION_NORMAL instead of GEXIV2_ORIENTATION_HFLIP(which is initial). May be I am overthinking this, but once we have "Rotate" capability in the edit mode, I think we might need to re-visit this. Otherwise, the rotated image will be exported with GEXIV2_ORIENTATION_NORMAL only.
(In reply to Umang Jain from comment #3) > Review of attachment 346204 [details] [review] [review]: > > It works as expected Thanks for taking a look! > but "neutralizing" in real terms means to replace with > same old initial value. Umm... does it? I meant it as 'nullify' or 'make incapable of action': http://www.dictionary.com/browse/neutralize I have now replaced it by 'remove'. > The attached image has orientation tag as > GEXIV2_ORIENTATION_HFLIP, but while exporting it's being "neutralized" by > GEXIV2_ORIENTATION_NORMAL instead of GEXIV2_ORIENTATION_HFLIP(which is > initial). If we were to keep using the original value of the orientation tag, then we would have to mirror/rotate the image back to its original orientation before exporting so that the orientation of the pixels matches that of the tag. Then any program that would decode the image would have to apply the orientation again. That seems like unnecessary hassle since the value of the orientation tag doesn't have as much value to the user as, say, all the camera tags. Nobody cares that much about how they held the camera as long as the pixels are fine. > May be I am overthinking this, but once we have "Rotate" capability in the > edit mode, I think we might need to re-visit this. Otherwise, the rotated > image will be exported with GEXIV2_ORIENTATION_NORMAL only. We can already rotate images without human interaction. That's how we apply the orientation when loading. So, no, this isn't related. :)