GNOME Bugzilla – Bug 440978
respect orientation tag when generating thumbnails
Last modified: 2007-08-10 20:31:53 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
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
*** Bug 335053 has been marked as a duplicate of this bug. ***
Created attachment 89603 [details] [review] updated patch, deleted obsolete header
Do we need to check for a specific version of libjpeg for this to work?
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
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
*** Bug 452755 has been marked as a duplicate of this bug. ***
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
Ok. Commit to trunk please.
Thanks, committed to svn trunk rev 5360. - Mike
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).
(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".
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