After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 778925 - Exported and shared items have their orientation applied twice
Exported and shared items have their orientation applied twice
Status: RESOLVED FIXED
Product: gnome-photos
Classification: Applications
Component: general
3.22.x
Other All
: Normal normal
: ---
Assigned To: GNOME photos maintainer(s)
GNOME photos maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-02-19 20:17 UTC by Debarshi Ray
Modified: 2017-02-20 06:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
base-item: Fix the orientation of exported and shared items (1005 bytes, patch)
2017-02-19 20:18 UTC, Debarshi Ray
committed Details | Review
An image with exif orientation as flipped (2.24 MB, image/jpeg)
2017-02-19 23:11 UTC, Umang Jain
  Details

Description Debarshi Ray 2017-02-19 20:17:53 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.
Comment 1 Debarshi Ray 2017-02-19 20:18:51 UTC
Created attachment 346204 [details] [review]
base-item: Fix the orientation of exported and shared items
Comment 2 Umang Jain 2017-02-19 23:11:04 UTC
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
Comment 3 Umang Jain 2017-02-19 23:17:39 UTC
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.
Comment 4 Debarshi Ray 2017-02-20 06:57:48 UTC
(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. :)