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 516177 - Desktop background does not honor EXIF orientation/rotation tag
Desktop background does not honor EXIF orientation/rotation tag
Status: RESOLVED FIXED
Product: gnome-desktop
Classification: Core
Component: libgnome-desktop
unspecified
Other All
: Normal normal
: ---
Assigned To: Desktop Maintainers
Desktop Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-02-13 05:20 UTC by David Barrett
Modified: 2017-05-30 16:39 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
gnome-bg: handle EXIF orientations (1.87 KB, patch)
2017-05-29 16:11 UTC, slatchurie
none Details | Review
gnome-bg: handle EXIF orientations (1.42 KB, patch)
2017-05-30 16:22 UTC, slatchurie
needs-work Details | Review
gnome-bg: Handle EXIF orientations (1.73 KB, patch)
2017-05-30 16:35 UTC, Bastien Nocera
committed Details | Review

Description David Barrett 2008-02-13 05:20:27 UTC
Please describe the problem:
If you choose a JPEG image in the Background tab of the Appearance Manager that has an EXIF rotation bit set (such as from the F-Spot photo manager), the image will be shown with the correct rotation in the selector, but will not be rotated correctly when actually applied to the desktop.

Steps to reproduce:
1. Take any JEPG image
2. Rotate with F-Spot (enable "Write metadata to file")
3. Select this image with the Appearance Manager
4. Note that the image appears correctly rotated in the dialog
5. Close the Appearance Manager and view the desktop
6. Note that the image does *not* appear correctly rotated on the desktop


Actual results:
The correct image is visible on the desktop, but it is not rotated.

Expected results:
I expected the correct image to both be visible and correctly rotated.

Does this happen every time?
Yes.

Other information:
I am running a stock, freshly-installed Ubuntu 7.10 desktop installation.  I installed using the "Alternate Install CD" and have enabled full-disk encryption.
Comment 1 Vincent Untz 2008-02-13 08:18:49 UTC
That's actually a nautilus bug.
Comment 2 jean-jaques 2008-11-25 15:29:04 UTC
This bug is still not fixed! I can confirm that even in GNOME/Nautilus from Ubuntu 8.10 the background is not being rotated correctly.
Comment 3 Matthew Gregg 2010-08-30 13:25:10 UTC
Nautilus still does not properly handle exif rotation data.  Images are properly rotated in most tools and thumbnails etc... It is PITA to have to move images out of F-spot, etc.. disable auto-rotation, rotate and resave, just to update the desktop background.
Comment 4 Oliver Smith 2012-04-10 11:13:16 UTC
I am running Ubuntu 12.04 (dev at the moment) and so far as I can see we are in the same situation.
I just found this bug trying to change the background with a "simple" picture taken from my iPhone 4S.
As Matthew said it is a real PITA!
Comment 5 William Jon McCann 2012-08-12 14:52:48 UTC
Does this still occur?
Comment 6 André Klapper 2014-12-10 05:05:42 UTC
Oliver, David, Matthew: Does this still occur in 3.14?
Comment 7 Bastien Nocera 2016-04-18 14:09:04 UTC
This github has examples pictures in different orientations:
https://github.com/recurser/exif-orientation-examples
Comment 8 Marcin Zajaczkowski 2016-12-29 23:16:50 UTC
This is still open in 3.22.

In additional to mentioned sample images a sample explanation of the Orientation tag in exif:
https://beradrian.wordpress.com/2008/11/14/rotate-exif-images/

Without that all pictures with non-default orientation have to be rotated externally (e.g. with exiftran) to look properly in Gnome.
Comment 9 Bastien Nocera 2016-12-29 23:27:46 UTC
(In reply to Marcin Zajaczkowski from comment #8)
> This is still open in 3.22.
> 
> In additional to mentioned sample images a sample explanation of the
> Orientation tag in exif:
> https://beradrian.wordpress.com/2008/11/14/rotate-exif-images/
> 
> Without that all pictures with non-default orientation have to be rotated
> externally (e.g. with exiftran) to look properly in Gnome.

If you want this fixed in gnome-shell, you'll need to open a bug against gnome-shell. The code here is only used by the Background panel, and maybe nautilus' desktop window.
Comment 10 Marcin Zajaczkowski 2017-01-02 22:49:09 UTC
Thanks for a tip. I created bug 776782.
Comment 11 slatchurie 2017-05-29 16:11:22 UTC
Created attachment 352797 [details] [review]
gnome-bg: handle EXIF orientations

I have already made a patch for mutter https://bugzilla.gnome.org/show_bug.cgi?id=783125
and one for the gnome-control-center https://bugzilla.gnome.org/show_bug.cgi?id=783200

Here is a patch for the previews in gnome-control-center's background panel.
Comment 12 Bastien Nocera 2017-05-30 06:04:19 UTC
Review of attachment 352797 [details] [review]:

::: libgnome-desktop/gnome-bg.c
@@ +898,3 @@
 {
 	GdkRectangle rect;
+	GdkPixbuf   *pixbuf, *rotated;

I'd prefer the "rotated" variable to be declared at the top of each block where it's used.

@@ +2559,3 @@
 	else {
 		orig = gdk_pixbuf_new_from_file (filename, NULL);
+

unneeded whitespace change.
Comment 13 slatchurie 2017-05-30 16:22:28 UTC
Created attachment 352883 [details] [review]
gnome-bg: handle EXIF orientations
Comment 14 Bastien Nocera 2017-05-30 16:35:02 UTC
Review of attachment 352883 [details] [review]:

I also made some changes to the commit message.

::: libgnome-desktop/gnome-bg.c
@@ +2568,3 @@
+				g_object_unref (orig);
+				orig = rotated;
+			}

I fixed the declarations that weren't at the top of the block.
Comment 15 Bastien Nocera 2017-05-30 16:35:37 UTC
Created attachment 352889 [details] [review]
gnome-bg: Handle EXIF orientations

Apply the orientation of the images provided as metadata in the EXIF
tags when loading images for display as background images (such as
in gnome-control-center's Background panel).
Comment 16 Bastien Nocera 2017-05-30 16:39:40 UTC
Attachment 352889 [details] pushed as d4fa248 - gnome-bg: Handle EXIF orientations