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 440978 - respect orientation tag when generating thumbnails
respect orientation tag when generating thumbnails
Status: RESOLVED FIXED
Product: libgnomeui
Classification: Deprecated
Component: general
CVS HEAD
Other Linux
: Normal normal
: future
Assigned To: libgnomeui maintainers
libgnomeui maintainers
: 335053 452755 (view as bug list)
Depends on: 439567
Blocks:
 
 
Reported: 2007-05-24 16:46 UTC by Michael Chudobiak
Modified: 2007-08-10 20:31 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
Orient the thumbnails correctly, using proposed new gtk+ functions (8.61 KB, patch)
2007-05-24 16:49 UTC, Michael Chudobiak
none Details | Review
updated patch, deleted obsolete header (8.94 KB, patch)
2007-06-08 13:23 UTC, Michael Chudobiak
none Details | Review
Updated patch, bumps gtk+ requirement (9.87 KB, patch)
2007-06-13 11:56 UTC, Michael Chudobiak
none Details | Review
Final version (10.08 KB, patch)
2007-07-03 11:50 UTC, Michael Chudobiak
accepted-commit_now Details | Review

Description Michael Chudobiak 2007-05-24 16:46:39 UTC
The libgnomeui thumbnailing code ignores embedded orientation tags when generating thumbnails. This causes it to conflict with other programs that share and/or generate thumbnails, like gthumb. See, for example:

bug 428725, bug 421349, bug 335053, and others.

A patch was committed in bug 428725 to allow the gdk-pixbuf tiff and jpeg loaders to associate the embedded orientation tag with an "orientation" pixbuf option. Bug 439567 has a patch (NOT committed yet; review is pending) to add a gdk_pixbuf_transform_orientation_auto function, to correct transform the pixbuf based on the orientation option.

This bug report provides a patch to take advantage of these new proposed functions to fix libgnomeui/Nautilus thumbnailing. A patch follows shortly.

- Mike
Comment 1 Michael Chudobiak 2007-05-24 16:49:59 UTC
Created attachment 88744 [details] [review]
Orient the thumbnails correctly, using proposed new gtk+ functions

This patch fixes the orientation issue.

Also, the old private scaled jpeg loader (_gnome_thumbnail_load_scaled_jpeg) and its support functions have been removed, because the gdk-pixbuf jpeg loader is  capable of fast scaling these days. Benchmarks confirm that there is no difference in speed. The gdk-pixbuf jpeg loader provides the orientation option that is required to transform the pixbuf properly; _gnome_thumbnail_load_scaled_jpeg didn't.

- Mike
Comment 2 Michael Chudobiak 2007-05-24 16:57:23 UTC
*** Bug 335053 has been marked as a duplicate of this bug. ***
Comment 3 Michael Chudobiak 2007-06-08 13:23:34 UTC
Created attachment 89603 [details] [review]
updated patch, deleted obsolete header
Comment 4 Kjartan Maraas 2007-06-12 13:39:01 UTC
Do we need to check for a specific version of libjpeg for this to work?
Comment 5 Michael Chudobiak 2007-06-12 13:54:55 UTC
No, I don't think so. The important stuff is in gdk-pixbuf/io-jpeg.c (i.e., decoding the orientation tag). Nothing special is required from libjpeg.

If the patch in bug 439567 is accepted, a requirement for gtk+ 2.12 would need to be added (if it isn't present already), because that's when gdk_pixbuf_transform_orientation_auto will hopefully appear...

- Mike


Comment 6 Michael Chudobiak 2007-06-13 11:56:45 UTC
Created attachment 89879 [details] [review]
Updated patch, bumps gtk+ requirement

This updated patch includes the configure.in and NEWS diffs needed to bump the gtk+ requirement to 2.11.3.

The blocking gtk+ patches haven't been committed yet, so that requirement will have to be tweaked before this patch is ready. (mclasen added the gtk+ api changes to the list at http://live.gnome.org/GTK%2B/SmallApiAdditions, so hopefully it will be accepted soon).

- Mike
Comment 7 Michael Chudobiak 2007-07-01 11:31:05 UTC
*** Bug 452755 has been marked as a duplicate of this bug. ***
Comment 8 Michael Chudobiak 2007-07-03 11:50:42 UTC
Created attachment 91092 [details] [review]
Final version

The gtk+ patch to add orientation tag support has been committed to gtk+ 2.11.5. This updated libgnomeui patch uses that to add orientation support to thumbnailing, and strips out old jpeg cruft.

This patch should be ready for committing, now.

- Mike
Comment 9 Kjartan Maraas 2007-07-14 12:43:52 UTC
Ok. Commit to trunk please.
Comment 10 Michael Chudobiak 2007-07-15 00:39:28 UTC
Thanks, committed to svn trunk rev 5360.

- Mike
Comment 11 Claudio Saavedra 2007-08-10 20:22:38 UTC
Michael, 

I'm a bit confused with this feature. Does this now mean that every libgnomeui generated thumbnail will be always rotated to respect the rotation metadata? I'm not completely sure yet (I'm a bit confused by the time), but I think we have a problem with that currently in EOG: The user can disable autorotation based in metadata. If that's the case, for a metadata-rotated image the displayed thumbnail will differ from the displayed thumbnail.

Wisdom and advice regarding this is appreciated (I'll probably open an bug about it).
Comment 12 Claudio Saavedra 2007-08-10 20:23:46 UTC
(In reply to comment #11)
> If that's the case, for a metadata-rotated image the
> displayed thumbnail will differ from the displayed thumbnail.

it should say "will differ from the displayed image".
Comment 13 Michael Chudobiak 2007-08-10 20:31:53 UTC
Hi Claudio,

Yes, every Nautilus-generated thumbnail will be rotated to respect the rotation metadata.

gThumb does the same - so there are at least two sources of "properly" rotated thumbnails.

For eog - I would either:

1) Always respect the orientation tag - why would you ignore it?

2) If you really, really, want to keep that feature, then I would suggest adding an ifdef to check the Nautilus or gtk version, and "un-rotating" the thumbnails when displayed if you want to "ignore" the tag. It's not elegant, but it should work...

- Mike