GNOME Bugzilla – Bug 361701
Cleanup of the transformation code.
Last modified: 2006-10-12 19:15:36 UTC
Please describe the problem: As I mentioned in bug 343867 comment 150, there are currently many ways to specify a transformation: RotatonData, GthExifOrientation, GthOrientation and GthTransform. The current code can be simplified by merging all those different enums and structs into only one structure. Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
Created attachment 74562 [details] [review] Patch to cleanup the transformation code Overview of the patch: * Merged RotatonData, GthExifOrientation and GthOrientation into GthTransform. The new enum contains all 8 possible transformations and is compatible with the exif orientation values. * Moved _gdk_pixbuf_transform_exif_orientation from image-loader.h to pixbuf-utils.h and renamed it to _gdk_pixbuf_transform. * Moved the implementation of the button callbacks in dlg-jpegtran.c to a common function. * Combined the two parameters rot_type and tran_type of the function dlg_apply_jpegtran into only one parameter. * Renamed the function update_rotation_from_exif_data in rotation-utils.h to read_orientation_field. * Rewrote the lossless jpeg transform to perform all types of transformations in one pass. * Rewrote the generic transform to use the _gdk_pixbuf_transform function. * Replaced the get_next_value_* functions with one new function (get_next_transformation) that supports all 8 transformations. Added two functions to find the rotation and mirror/flip part of a transformation.
Jef, Wow, nice work! You are juggling a lot of balls! This patch seems to work correctly for the rotation dialog. (I haven't tested the import functions because my camera is at home.) I haven't seen any issues. I like how you've kept my basic code outline in the rotation function, while still making it much more efficient. Does this supercede your previous patch entirely? - Mike
Oh, I forgot to mention that it co-exists nicely with my reset tool patch (http://bugzilla.gnome.org/show_bug.cgi?id=343867#c159). - Mike
Actually, never mind my comment about my keeping my code. It is terribly inefficient still (my fault). - Mike
patch applied to CVS, thanks.