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 361701 - Cleanup of the transformation code.
Cleanup of the transformation code.
Status: RESOLVED FIXED
Product: gthumb
Classification: Other
Component: general
2.9.x
Other All
: Normal normal
: ---
Assigned To: Paolo Bacchilega
Paolo Bacchilega
Depends on:
Blocks:
 
 
Reported: 2006-10-12 13:56 UTC by Jef Driesen
Modified: 2006-10-12 19:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to cleanup the transformation code (32.40 KB, patch)
2006-10-12 14:07 UTC, Jef Driesen
none Details | Review

Description Jef Driesen 2006-10-12 13:56:04 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:
Comment 1 Jef Driesen 2006-10-12 14:07:12 UTC
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.
Comment 2 Michael Chudobiak 2006-10-12 15:45:37 UTC
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
Comment 3 Michael Chudobiak 2006-10-12 15:47:15 UTC
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
Comment 4 Michael Chudobiak 2006-10-12 15:54:20 UTC
Actually, never mind my comment about my keeping my code. It is terribly inefficient still (my fault).

- Mike
Comment 5 Paolo Bacchilega 2006-10-12 19:15:36 UTC
patch applied to CVS, thanks.