Commit 05abd885 authored by Paolo Bacchilega's avatar Paolo Bacchilega Committed by Paolo Bacchilega
Browse files

Merged RotatonData, GthExifOrientation and GthOrientation into

2006-10-12  Paolo Bacchilega  <paobac@cvs.gnome.org>

        * src/rotation-utils.h (update_orientation_field):
        * src/rotation-utils.c:
        * src/gth-window-actions-callbacks.c (adjust_orientation__step):
        * src/dlg-photo-importer.c:
        * src/dlg-jpegtran.h:
        * src/dlg-jpegtran.c:
        * libgthumb/typedefs.h:
        * libgthumb/pixbuf-utils.h (pixmap_from_xpm):
        * libgthumb/pixbuf-utils.c:
        * libgthumb/image-loader.c (image_loader_set_pixbuf):
        * libgthumb/gth-exif-utils.h:

        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.

        Patch by Jef Driesen.  Bug #361701
parent 0e0ac0f6
2006-10-12 Paolo Bacchilega <paobac@cvs.gnome.org>
* src/rotation-utils.h (update_orientation_field):
* src/rotation-utils.c:
* src/gth-window-actions-callbacks.c (adjust_orientation__step):
* src/dlg-photo-importer.c:
* src/dlg-jpegtran.h:
* src/dlg-jpegtran.c:
* libgthumb/typedefs.h:
* libgthumb/pixbuf-utils.h (pixmap_from_xpm):
* libgthumb/pixbuf-utils.c:
* libgthumb/image-loader.c (image_loader_set_pixbuf):
* libgthumb/gth-exif-utils.h:
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.
Patch by Jef Driesen. Bug #361701
* src/gth-browser-ui.h: move ResetExif under RotateImages, add a
searator.
......
......@@ -33,19 +33,6 @@
#include "jpegutils/jpeg-data.h"
typedef enum { /*< skip >*/
GTH_EXIF_ORIENTATION_NONE = 0,
GTH_EXIF_ORIENTATION_TOP_LEFT,
GTH_EXIF_ORIENTATION_TOP_RIGHT,
GTH_EXIF_ORIENTATION_BOTTOM_RIGHT,
GTH_EXIF_ORIENTATION_BOTTOM_LEFT,
GTH_EXIF_ORIENTATION_LEFT_TOP,
GTH_EXIF_ORIENTATION_RIGHT_TOP,
GTH_EXIF_ORIENTATION_RIGHT_BOTTOM,
GTH_EXIF_ORIENTATION_LEFT_BOTTOM
} GthExifOrientation;
char * get_exif_tag (const char *filename,
ExifTag etag);
ExifShort get_exif_tag_short (const char *filename,
......
......@@ -407,70 +407,23 @@ image_loader_set_pixbuf (ImageLoader *il,
g_mutex_unlock (priv->yes_or_no);
}
/*
* Returns an image, transformed according
* to the Exif orientation data.
*/
static GdkPixbuf *
_gdk_pixbuf_transform_exif_orientation (GdkPixbuf* src,
GthExifOrientation orientation)
{
GdkPixbuf *temp = NULL, *dest = NULL;
if (!src) return NULL;
switch (orientation) {
case GTH_EXIF_ORIENTATION_TOP_LEFT:
dest = src;
g_object_ref (dest);
break;
case GTH_EXIF_ORIENTATION_TOP_RIGHT:
dest = _gdk_pixbuf_copy_mirror (src, TRUE, FALSE);
break;
case GTH_EXIF_ORIENTATION_BOTTOM_RIGHT:
dest = _gdk_pixbuf_copy_mirror (src, TRUE, TRUE);
break;
case GTH_EXIF_ORIENTATION_BOTTOM_LEFT:
dest = _gdk_pixbuf_copy_mirror (src, FALSE, TRUE);
break;
case GTH_EXIF_ORIENTATION_LEFT_TOP:
temp = _gdk_pixbuf_copy_rotate_90 (src, FALSE);
dest = _gdk_pixbuf_copy_mirror (temp, TRUE, FALSE);
g_object_unref (temp);
break;
case GTH_EXIF_ORIENTATION_RIGHT_TOP:
dest = _gdk_pixbuf_copy_rotate_90 (src, FALSE);
break;
case GTH_EXIF_ORIENTATION_RIGHT_BOTTOM:
temp = _gdk_pixbuf_copy_rotate_90 (src, FALSE);
dest = _gdk_pixbuf_copy_mirror (temp, FALSE, TRUE);
g_object_unref (temp);
break;
case GTH_EXIF_ORIENTATION_LEFT_BOTTOM:
dest = _gdk_pixbuf_copy_rotate_90 (src, TRUE);
break;
default:
dest = src;
g_object_ref (dest);
break;
}
return dest;
}
static void
image_loader_sync_pixbuf (ImageLoader *il)
{
GdkPixbuf *pixbuf;
GdkPixbuf *temp;
ImageLoaderPrivateData *priv;
GthExifOrientation orientation;
ExifShort orientation;
GthTransform transform;
g_return_if_fail (il != NULL);
priv = il->priv;
orientation = get_exif_tag_short (image_loader_get_path(il), EXIF_TAG_ORIENTATION);
transform = (orientation >= 1 && orientation <= 8 ?
orientation :
GTH_TRANSFORM_NONE);
g_mutex_lock (priv->yes_or_no);
......@@ -483,7 +436,7 @@ image_loader_sync_pixbuf (ImageLoader *il)
}
temp = gdk_pixbuf_animation_get_static_image (priv->animation);
pixbuf = _gdk_pixbuf_transform_exif_orientation (temp, orientation);
pixbuf = _gdk_pixbuf_transform (temp, transform);
if (priv->pixbuf == pixbuf) {
g_object_unref (pixbuf);
......
......@@ -213,6 +213,57 @@ _gdk_pixbuf_copy_mirror (GdkPixbuf *src,
}
/*
* Returns a transformed image.
*/
GdkPixbuf *
_gdk_pixbuf_transform (GdkPixbuf* src,
GthTransform transform)
{
GdkPixbuf *temp = NULL, *dest = NULL;
if (!src) return NULL;
switch (transform) {
case GTH_TRANSFORM_NONE:
dest = src;
g_object_ref (dest);
break;
case GTH_TRANSFORM_FLIP_H:
dest = _gdk_pixbuf_copy_mirror (src, TRUE, FALSE);
break;
case GTH_TRANSFORM_ROTATE_180:
dest = _gdk_pixbuf_copy_mirror (src, TRUE, TRUE);
break;
case GTH_TRANSFORM_FLIP_V:
dest = _gdk_pixbuf_copy_mirror (src, FALSE, TRUE);
break;
case GTH_TRANSFORM_TRANSPOSE:
temp = _gdk_pixbuf_copy_rotate_90 (src, FALSE);
dest = _gdk_pixbuf_copy_mirror (temp, TRUE, FALSE);
g_object_unref (temp);
break;
case GTH_TRANSFORM_ROTATE_90:
dest = _gdk_pixbuf_copy_rotate_90 (src, FALSE);
break;
case GTH_TRANSFORM_TRANSVERSE:
temp = _gdk_pixbuf_copy_rotate_90 (src, FALSE);
dest = _gdk_pixbuf_copy_mirror (temp, FALSE, TRUE);
g_object_unref (temp);
break;
case GTH_TRANSFORM_ROTATE_270:
dest = _gdk_pixbuf_copy_rotate_90 (src, TRUE);
break;
default:
dest = src;
g_object_ref (dest);
break;
}
return dest;
}
void
pixmap_from_xpm (const char **data,
GdkPixmap **pixmap,
......
......@@ -27,6 +27,8 @@
#include <gdk/gdk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "typedefs.h"
void pixmap_from_xpm (const char **data,
GdkPixmap **pixmap,
GdkBitmap **mask);
......@@ -52,6 +54,9 @@ GdkPixbuf *_gdk_pixbuf_copy_mirror (GdkPixbuf *src,
gboolean mirror,
gboolean flip);
GdkPixbuf *_gdk_pixbuf_transform (GdkPixbuf* src,
GthTransform transform);
gboolean _gdk_pixbuf_save (GdkPixbuf *pixbuf,
const char *filename,
const char *type,
......
......@@ -204,13 +204,14 @@ typedef enum { /*< skip >*/
typedef enum { /*< skip >*/
GTH_TRANSFORM_ROTATE_0,
GTH_TRANSFORM_ROTATE_90,
GTH_TRANSFORM_ROTATE_180,
GTH_TRANSFORM_ROTATE_270,
GTH_TRANSFORM_NONE,
GTH_TRANSFORM_MIRROR,
GTH_TRANSFORM_FLIP
GTH_TRANSFORM_NONE = 1, /* no transformation */
GTH_TRANSFORM_FLIP_H, /* horizontal flip */
GTH_TRANSFORM_ROTATE_180, /* 180-degree rotation */
GTH_TRANSFORM_FLIP_V, /* vertical flip */
GTH_TRANSFORM_TRANSPOSE, /* transpose across UL-to-LR axis (= rotate_90 + flip_h) */
GTH_TRANSFORM_ROTATE_90, /* 90-degree clockwise rotation */
GTH_TRANSFORM_TRANSVERSE, /* transpose across UR-to-LL axis (= rotate_90 + flip_v) */
GTH_TRANSFORM_ROTATE_270 /* 270-degree clockwise */
} GthTransform;
......
......@@ -75,7 +75,7 @@ typedef struct {
GList *current_image;
ImageLoader *loader;
GdkPixbuf *original_preview;
RotationData *rot_data;
GthTransform transform;
} DialogData;
......@@ -95,7 +95,6 @@ dialog_data_free (DialogData *data)
g_object_unref (data->loader);
if (data->gui != NULL)
g_object_unref (data->gui);
g_free (data->rot_data);
g_free (data);
}
......@@ -192,8 +191,7 @@ load_current_image (DialogData *data)
image_loader_set_path (data->loader, path);
image_loader_start (data->loader);
data->rot_data->rot_type = GTH_TRANSFORM_ROTATE_0;
data->rot_data->tran_type = GTH_TRANSFORM_NONE;
data->transform = GTH_TRANSFORM_NONE;
}
......@@ -265,14 +263,14 @@ apply_transformation (DialogData *data,
transform the data using the "lossless" jpeg
mathematical transform (only really lossless if
dimensions are multiples of 8 */
apply_transformation_jpeg (window, path, data->rot_data);
apply_transformation_jpeg (window, path, data->transform);
}
else {
/* Calculate a new orientation tag, based on the
input tag and the requested rotation. This saves
the jpeg, so no further action is required if
"adjust photo orientation" is not selected. */
update_orientation_field (path, data->rot_data);
update_orientation_field (path, data->transform);
/* if "adjust photo orientation" is selected mathematically transform
the data so that the viewed image remains the same, but the
......@@ -285,15 +283,15 @@ apply_transformation (DialogData *data,
if (!(height%8) && !(width%8)) {
/* Don't do this if the dimensions are not multiples
of the jpeg minimum coding unit (iMCU = 8) */
update_rotation_from_exif_data (path, data->rot_data);
apply_transformation_jpeg (window, path, data->rot_data);
data->transform = read_orientation_field (path);
apply_transformation_jpeg (window, path, data->transform);
}
}
}
}
else
apply_transformation_generic (window, path, data->rot_data);
apply_transformation_generic (window, path, data->transform);
gnome_vfs_set_file_info (path, &info, GNOME_VFS_SET_FILE_INFO_PERMISSIONS|GNOME_VFS_SET_FILE_INFO_OWNER);
notify_file_changed (data, path, notify_soon);
......@@ -381,23 +379,11 @@ ok_clicked (GtkWidget *button,
}
static int
get_next_rot (int rot)
{
int next_rot [4] = {GTH_TRANSFORM_ROTATE_90,
GTH_TRANSFORM_ROTATE_180,
GTH_TRANSFORM_ROTATE_270,
GTH_TRANSFORM_ROTATE_0};
return next_rot [rot];
}
static void
revert_clicked (GtkWidget *button,
DialogData *data)
{
data->rot_data->rot_type = GTH_TRANSFORM_ROTATE_0;
data->rot_data->tran_type = GTH_TRANSFORM_NONE;
data->transform = GTH_TRANSFORM_NONE;
if (data->original_preview != NULL)
gtk_image_set_from_pixbuf (GTK_IMAGE (data->j_preview_image), data->original_preview);
......@@ -405,26 +391,21 @@ revert_clicked (GtkWidget *button,
static void
rot90_clicked (GtkWidget *button,
DialogData *data)
transform_clicked_impl (GtkWidget *button,
DialogData *data,
GthTransform transform)
{
GdkPixbuf *src_pixbuf;
GdkPixbuf *dest_pixbuf;
GdkPixbuf *src_pixbuf = NULL;
GdkPixbuf *dest_pixbuf = NULL;
if (data->rot_data->tran_type == GTH_TRANSFORM_NONE)
data->rot_data->rot_type = get_next_rot (data->rot_data->rot_type);
else {
data->rot_data->rot_type = get_next_rot (data->rot_data->rot_type);
data->rot_data->rot_type = get_next_rot (data->rot_data->rot_type);
data->rot_data->rot_type = get_next_rot (data->rot_data->rot_type);
}
data->transform = get_next_transformation (data->transform, transform);
src_pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (data->j_preview_image));
if (src_pixbuf == NULL)
return;
dest_pixbuf = _gdk_pixbuf_copy_rotate_90 (src_pixbuf, FALSE);
dest_pixbuf = _gdk_pixbuf_transform (src_pixbuf, transform);
gtk_image_set_from_pixbuf (GTK_IMAGE (data->j_preview_image), dest_pixbuf);
if (dest_pixbuf != NULL)
......@@ -433,29 +414,18 @@ rot90_clicked (GtkWidget *button,
static void
rot270_clicked (GtkWidget *button,
DialogData *data)
rot90_clicked (GtkWidget *button,
DialogData *data)
{
GdkPixbuf *src_pixbuf;
GdkPixbuf *dest_pixbuf;
if (data->rot_data->tran_type == GTH_TRANSFORM_NONE) {
data->rot_data->rot_type = get_next_rot (data->rot_data->rot_type);
data->rot_data->rot_type = get_next_rot (data->rot_data->rot_type);
data->rot_data->rot_type = get_next_rot (data->rot_data->rot_type);
} else
data->rot_data->rot_type = get_next_rot (data->rot_data->rot_type);
src_pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (data->j_preview_image));
if (src_pixbuf == NULL)
return;
transform_clicked_impl (button, data, GTH_TRANSFORM_ROTATE_90);
}
dest_pixbuf = _gdk_pixbuf_copy_rotate_90 (src_pixbuf, TRUE);
gtk_image_set_from_pixbuf (GTK_IMAGE (data->j_preview_image), dest_pixbuf);
if (dest_pixbuf != NULL)
g_object_unref (dest_pixbuf);
static void
rot270_clicked (GtkWidget *button,
DialogData *data)
{
transform_clicked_impl (button, data, GTH_TRANSFORM_ROTATE_270);
}
......@@ -463,30 +433,7 @@ static void
mirror_clicked (GtkWidget *button,
DialogData *data)
{
GdkPixbuf *src_pixbuf;
GdkPixbuf *dest_pixbuf;
src_pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (data->j_preview_image));
if (src_pixbuf == NULL)
return;
if (data->rot_data->tran_type == GTH_TRANSFORM_FLIP) {
data->rot_data->tran_type = GTH_TRANSFORM_NONE;
data->rot_data->rot_type = get_next_rot (data->rot_data->rot_type);
data->rot_data->rot_type = get_next_rot (data->rot_data->rot_type);
} else if (data->rot_data->tran_type == GTH_TRANSFORM_MIRROR)
data->rot_data->tran_type = GTH_TRANSFORM_NONE;
else
data->rot_data->tran_type = GTH_TRANSFORM_MIRROR;
dest_pixbuf = _gdk_pixbuf_copy_mirror (src_pixbuf, TRUE, FALSE);
gtk_image_set_from_pixbuf (GTK_IMAGE (data->j_preview_image), dest_pixbuf);
if (dest_pixbuf != NULL)
g_object_unref (dest_pixbuf);
transform_clicked_impl (button, data, GTH_TRANSFORM_FLIP_H);
}
......@@ -494,30 +441,7 @@ static void
flip_clicked (GtkWidget *button,
DialogData *data)
{
GdkPixbuf *src_pixbuf;
GdkPixbuf *dest_pixbuf;
if (data->rot_data->tran_type == GTH_TRANSFORM_MIRROR) {
data->rot_data->tran_type = GTH_TRANSFORM_NONE;
data->rot_data->rot_type = get_next_rot (data->rot_data->rot_type);
data->rot_data->rot_type = get_next_rot (data->rot_data->rot_type);
} else if (data->rot_data->tran_type == GTH_TRANSFORM_FLIP)
data->rot_data->tran_type = GTH_TRANSFORM_NONE;
else
data->rot_data->tran_type = GTH_TRANSFORM_FLIP;
src_pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (data->j_preview_image));
if (src_pixbuf == NULL)
return;
dest_pixbuf = _gdk_pixbuf_copy_mirror (src_pixbuf, FALSE, TRUE);
gtk_image_set_from_pixbuf (GTK_IMAGE (data->j_preview_image), dest_pixbuf);
if (dest_pixbuf != NULL)
g_object_unref (dest_pixbuf);
transform_clicked_impl (button, data, GTH_TRANSFORM_FLIP_V);
}
......@@ -603,7 +527,7 @@ dlg_jpegtran (GthWindow *window)
return;
}
data->rot_data = rotation_data_new ();
data->transform = GTH_TRANSFORM_NONE;
/* Get the widgets. */
......@@ -712,8 +636,7 @@ dlg_jpegtran (GthWindow *window)
void
dlg_apply_jpegtran (GthWindow *window,
GthTransform rot_type,
GthTransform tran_type)
GthTransform transform)
{
DialogData *data;
GList *list;
......@@ -730,10 +653,7 @@ dlg_apply_jpegtran (GthWindow *window,
data->window = window;
data->file_list = list;
data->current_image = list;
data->rot_data = rotation_data_new();
data->rot_data->rot_type = rot_type;
data->rot_data->tran_type = tran_type;
data->transform = transform;
apply_transformation_to_all (data);
}
......@@ -29,7 +29,6 @@
void dlg_jpegtran (GthWindow *window);
void dlg_apply_jpegtran (GthWindow *window,
GthTransform rot_type,
GthTransform tran_type);
GthTransform transform);
#endif /* DLG_JPEGTRAN_H */
......@@ -1371,16 +1371,13 @@ adjust_orientation__step (AsyncOperationData *aodata,
if (file_is_image (filepath, TRUE)) {
FileData *fd = file_data_new (filepath, &info);
RotationData *rot_data = rotation_data_new ();
update_rotation_from_exif_data (fd->path, rot_data);
GthTransform transform = read_orientation_field (fd->path);
if (image_is_jpeg (filepath))
apply_transformation_jpeg (window, fd->path, rot_data);
apply_transformation_jpeg (window, fd->path, transform);
else
apply_transformation_generic (window, fd->path, rot_data);
apply_transformation_generic (window, fd->path, transform);
file_data_unref (fd);
g_free (rot_data);
}
gnome_vfs_set_file_info (filepath, &info, GNOME_VFS_SET_FILE_INFO_PERMISSIONS|GNOME_VFS_SET_FILE_INFO_OWNER);
......
......@@ -897,10 +897,10 @@ void
gth_window_activate_action_tools_jpeg_rotate_right (GtkAction *action,
GthWindow *window)
{
void (*module) (GthWindow *, GthTransform, GthTransform);
void (*module) (GthWindow *, GthTransform);
if (gthumb_module_get ("dlg_apply_jpegtran", (gpointer*) &module))
(*module) (window, GTH_TRANSFORM_ROTATE_90, GTH_TRANSFORM_NONE);
(*module) (window, GTH_TRANSFORM_ROTATE_90);
}
......@@ -908,8 +908,8 @@ void
gth_window_activate_action_tools_jpeg_rotate_left (GtkAction *action,
GthWindow *window)
{
void (*module) (GthWindow *, GthTransform, GthTransform);
void (*module) (GthWindow *, GthTransform);
if (gthumb_module_get ("dlg_apply_jpegtran", (gpointer*) &module))
(*module) (window, GTH_TRANSFORM_ROTATE_270, GTH_TRANSFORM_NONE);
(*module) (window, GTH_TRANSFORM_ROTATE_270);
}
......@@ -34,75 +34,22 @@
#include "jpegutils/transupp.h"
#include "jpegutils/jpegtran.h"
RotationData*
rotation_data_new ()
{
RotationData *rd;
rd = g_new0 (RotationData, 1);
rd->rot_type = GTH_TRANSFORM_ROTATE_0;
rd->tran_type = GTH_TRANSFORM_NONE;
return rd;
}
void
update_rotation_from_exif_data (const char *path,
RotationData *rot_data)
GthTransform
read_orientation_field (const char *path)
{
GthExifOrientation orientation;
rot_data->rot_type = GTH_TRANSFORM_ROTATE_0;
rot_data->tran_type = GTH_TRANSFORM_NONE;
ExifShort orientation;
path = get_file_path_from_uri (path);
if (path == NULL)
return;
orientation = get_exif_tag_short (path, EXIF_TAG_ORIENTATION);
return GTH_TRANSFORM_NONE;
switch (orientation) {
case GTH_EXIF_ORIENTATION_TOP_LEFT:
rot_data->rot_type = GTH_TRANSFORM_ROTATE_0;
rot_data->tran_type = GTH_TRANSFORM_NONE;
break;
case GTH_EXIF_ORIENTATION_TOP_RIGHT:
rot_data->rot_type = GTH_TRANSFORM_ROTATE_0;
rot_data->tran_type = GTH_TRANSFORM_MIRROR;
break;
case GTH_EXIF_ORIENTATION_BOTTOM_RIGHT:
rot_data->rot_type = GTH_TRANSFORM_ROTATE_180;
rot_data->tran_type = GTH_TRANSFORM_NONE;
break;
case GTH_EXIF_ORIENTATION_BOTTOM_LEFT:
rot_data->rot_type = GTH_TRANSFORM_ROTATE_180;
rot_data->tran_type = GTH_TRANSFORM_MIRROR;
break;
case GTH_EXIF_ORIENTATION_LEFT_TOP:
rot_data->rot_type = GTH_TRANSFORM_ROTATE_90;
rot_data->tran_type = GTH_TRANSFORM_MIRROR;
break;
case GTH_EXIF_ORIENTATION_RIGHT_TOP:
rot_data->rot_type = GTH_TRANSFORM_ROTATE_90;
rot_data->tran_type = GTH_TRANSFORM_NONE;
break;
case GTH_EXIF_ORIENTATION_RIGHT_BOTTOM:
rot_data->rot_type = GTH_TRANSFORM_ROTATE_90;
rot_data->tran_type = GTH_TRANSFORM_FLIP;
break;
case GTH_EXIF_ORIENTATION_LEFT_BOTTOM:
rot_data->rot_type = GTH_TRANSFORM_ROTATE_270;
rot_data->tran_type = GTH_TRANSFORM_NONE;
break;
default:
rot_data->rot_type = GTH_TRANSFORM_ROTATE_0;
rot_data->tran_type = GTH_TRANSFORM_NONE;
break;
}