summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Finke <jens@triq.net>2003-12-08 18:09:30 +0000
committerJens Finke <jens@src.gnome.org>2003-12-08 18:09:30 +0000
commit936c0034075dd59f6f0dc8f5b0f85972c1e63c08 (patch)
tree44bd7e4f4b78d17b9288e509e3f98bf61c534f58
parentbe524a21e3a5d8a644f448f1d715b1b30fb5ea4a (diff)
downloadeog-936c0034075dd59f6f0dc8f5b0f85972c1e63c08.tar.gz
Lossless saving for local/unmodified files and local/modified jpeg images.
2003-12-08 Jens Finke <jens@triq.net> Lossless saving for local/unmodified files and local/modified jpeg images. Needs more testing. * Makefile.am: * acconfig.h: Added jpegutils compile magic. * configure.in: Bumped version to 2.5.1. Define ENABLE_JPEG. * viewer/Makefile.am, * collection/Makefile.am: Link to libeog-jpegutils conditionally. * libeog/Makefile.am: Include jpegutils dir. * libeog/eog-image-jpeg.[ch]: Build only if HAVE_JPEG is true. (eog_image_jpeg_save_lossless): New function. * libeog/eog-image-private.h: New file_type attribute. * libeog/eog-image.c (real_image_load): Store file format used for loading of the image. (is_local_uri), (get_save_file_type_by_suffix): New functions. (eog_image_save): Reworked function. Tries to be as smart as possible in using the least lossy save method. * libeog/eog-transform.[ch] (eog_transform_get_transform_type): New function. * jpegutils/*: New files, borrowed from GThumb.
-rw-r--r--ChangeLog32
-rw-r--r--Makefile.am7
-rw-r--r--acconfig.h2
-rw-r--r--collection/Makefile.am8
-rw-r--r--configure.in5
-rw-r--r--libeog/Makefile.am1
-rw-r--r--libeog/eog-image-jpeg.c61
-rw-r--r--libeog/eog-image-jpeg.h9
-rw-r--r--libeog/eog-image-private.h1
-rw-r--r--libeog/eog-image.c196
-rw-r--r--libeog/eog-transform.c42
-rw-r--r--libeog/eog-transform.h10
-rw-r--r--viewer/Makefile.am9
13 files changed, 318 insertions, 65 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b6c27f8..4b840a1f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,35 @@
+2003-12-08 Jens Finke <jens@triq.net>
+
+ Lossless saving for local/unmodified files and local/modified jpeg
+ images. Needs more testing.
+
+ * Makefile.am:
+ * acconfig.h: Added jpegutils compile magic.
+
+ * configure.in: Bumped version to 2.5.1. Define ENABLE_JPEG.
+
+ * viewer/Makefile.am,
+ * collection/Makefile.am: Link to libeog-jpegutils conditionally.
+
+ * libeog/Makefile.am: Include jpegutils dir.
+
+ * libeog/eog-image-jpeg.[ch]: Build only if HAVE_JPEG is true.
+ (eog_image_jpeg_save_lossless): New function.
+
+ * libeog/eog-image-private.h: New file_type attribute.
+
+ * libeog/eog-image.c (real_image_load): Store file format used for
+ loading of the image.
+ (is_local_uri),
+ (get_save_file_type_by_suffix): New functions.
+ (eog_image_save): Reworked function. Tries to be as smart as
+ possible in using the least lossy save method.
+
+ * libeog/eog-transform.[ch] (eog_transform_get_transform_type):
+ New function.
+
+ * jpegutils/*: New files, borrowed from GThumb.
+
2003-11-24 Jens Finke <jens@triq.net>
Display filesize information.
diff --git a/Makefile.am b/Makefile.am
index ee38cafb..54f7f67d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,9 @@
-SUBDIRS = art idl libgpi libeog viewer collection shell po help
+if ENABLE_JPEG
+jpeg_DIRS = jpegutils
+endif
+
+SUBDIRS = art idl libgpi $(jpeg_DIRS) libeog viewer collection shell po help
+DIST_SUBDIRS = $(SUBDIRS) jpegutils
EXTRA_DIST = \
DEPENDS \
diff --git a/acconfig.h b/acconfig.h
index 10613129..169f1dab 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -21,4 +21,4 @@
#undef GCONF_CONFIG_SOURCE
#undef INSTALL_GCONF_CONFIG_SOURCE
#undef HAVE_EXIF
-
+#undef HAVE_LIBJPEG
diff --git a/collection/Makefile.am b/collection/Makefile.am
index 1360b0d7..12d04f6a 100644
--- a/collection/Makefile.am
+++ b/collection/Makefile.am
@@ -1,3 +1,8 @@
+if ENABLE_JPEG
+jpeg_LIB = -L$(top_builddir)/jpegutils -leog-jpegutils
+jpeg_DEPS = $(top_builddir)/jpegutils/libeog-jpegutils.a
+endif
+
INCLUDES = \
-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
-DG_LOG_DOMAIN=\"Eog\" \
@@ -40,11 +45,12 @@ eog_collection_view_SOURCES = \
eog-save-dialog.c \
main.c
-eog_collection_view_DEPENDENCIES = $(top_builddir)/libeog/libeog.a
+eog_collection_view_DEPENDENCIES = $(top_builddir)/libeog/libeog.a $(jpeg_DEPS)
eog_collection_view_LDADD = \
-L$(top_builddir)/libeog \
-leog \
+ $(jpeg_LIB) \
$(EOG_LIBS) \
$(INTLLIBS) \
$(X_LIBS) \
diff --git a/configure.in b/configure.in
index c18c6c90..9dde0b86 100644
--- a/configure.in
+++ b/configure.in
@@ -4,7 +4,7 @@ AC_INIT(shell/main.c)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(eog, 2.5.0.1)
+AM_INIT_AUTOMAKE(eog, 2.5.1)
AM_MAINTAINER_MODE
@@ -89,6 +89,7 @@ AC_ARG_WITH(libjpeg, [ --without-libjpeg disable special JPEG support])
if test "$have_jpeg" = yes; then
LIBJPEG='-ljpeg'
AC_DEFINE(HAVE_JPEG, 1)
+ AC_DEFINE(HAVE_LIBJPEG, 1)
AC_CHECK_LIB(jpeg, jpeg_simple_progression,
AC_DEFINE(HAVE_PROGRESSIVE_JPEG),
AC_MSG_WARN(JPEG library does not support progressive saving.))
@@ -105,6 +106,7 @@ AC_ARG_WITH(libjpeg, [ --without-libjpeg disable special JPEG support])
*** not work properly])
fi
AC_SUBST(LIBJPEG)
+AM_CONDITIONAL(ENABLE_JPEG, test x$have_jpeg = xyes)
dnl ============ CFLAGS & LIBS initialization ===============
@@ -185,6 +187,7 @@ eog.spec
art/Makefile
libeog/Makefile
libeog/cursors/Makefile
+jpegutils/Makefile
libgpi/Makefile
collection/Makefile
viewer/Makefile
diff --git a/libeog/Makefile.am b/libeog/Makefile.am
index 449bfdad..d46c3d02 100644
--- a/libeog/Makefile.am
+++ b/libeog/Makefile.am
@@ -7,6 +7,7 @@ INCLUDES = \
-DDATADIR=\""$(datadir)"\" \
-I$(srcdir) -I$(top_srcdir) \
-I$(top_srcdir)/src \
+ -I$(top_srcdir)/jpegutils \
-I$(top_builddir) \
$(EOG_CFLAGS) \
$(WARN_CFLAGS)
diff --git a/libeog/eog-image-jpeg.c b/libeog/eog-image-jpeg.c
index 75094761..eb77c445 100644
--- a/libeog/eog-image-jpeg.c
+++ b/libeog/eog-image-jpeg.c
@@ -28,27 +28,27 @@
* Boston, MA 02111-1307, USA.
*/
-#include <config.h>
+#include "eog-image-jpeg.h"
+
+#if HAVE_JPEG
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <setjmp.h>
-#if HAVE_JPEG
+#include <jpegtran.h>
#include <jpeglib.h>
#include <jerror.h>
-#endif
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <libgnome/gnome-i18n.h>
#if HAVE_EXIF
#include <libexif/exif-data.h>
#endif
-#include "eog-image-jpeg.h"
#include "eog-image-private.h"
gboolean
eog_image_jpeg_save (EogImage *image, const char *path, GError **error)
{
-#if HAVE_JPEG
EogImagePrivate *priv;
GdkPixbuf *pixbuf;
struct jpeg_compress_struct cinfo;
@@ -63,7 +63,7 @@ eog_image_jpeg_save (EogImage *image, const char *path, GError **error)
int rowstride = 0;
FILE *outfile;
struct jpeg_error_mgr jerr;
-#ifdef HAVE_EXIF
+#if HAVE_EXIF
unsigned char *exif_buf;
unsigned int exif_buf_len;
#endif
@@ -118,7 +118,7 @@ eog_image_jpeg_save (EogImage *image, const char *path, GError **error)
jpeg_set_quality (&cinfo, quality, TRUE);
jpeg_start_compress (&cinfo, TRUE);
-#ifdef HAVE_EXIF
+#if HAVE_EXIF
if (priv->exif != NULL)
{
g_print ("save exif data\n");
@@ -152,7 +152,48 @@ eog_image_jpeg_save (EogImage *image, const char *path, GError **error)
fclose (outfile);
return TRUE;
-#else
- return gdk_pixbuf_save (image->priv->image, path, "jpeg", error, NULL);
-#endif
}
+
+gboolean
+eog_image_jpeg_save_lossless (EogImage *image, const char *path, GError **error)
+{
+ const char *img_path;
+ int result;
+ JXFORM_CODE trans_code = JXFORM_NONE;
+ EogTransformType transformation;
+
+ g_return_val_if_fail (EOG_IS_IMAGE (image), FALSE);
+ g_return_val_if_fail (path != NULL, FALSE);
+
+ img_path = gnome_vfs_uri_get_path (image->priv->uri);
+
+ if (image->priv->trans != NULL) {
+ transformation = eog_transform_get_transform_type (image->priv->trans);
+ switch (transformation) {
+ case EOG_TRANSFORM_ROT_90:
+ trans_code = JXFORM_ROT_90;
+ break;
+ case EOG_TRANSFORM_ROT_270:
+ trans_code = JXFORM_ROT_270;
+ break;
+ case EOG_TRANSFORM_ROT_180:
+ trans_code = JXFORM_ROT_180;
+ break;
+ case EOG_TRANSFORM_FLIP_HORIZONTAL:
+ trans_code = JXFORM_FLIP_H;
+ break;
+ case EOG_TRANSFORM_FLIP_VERTICAL:
+ trans_code = JXFORM_FLIP_V;
+ break;
+ default:
+ trans_code = JXFORM_NONE;
+ break;
+ }
+ }
+
+ result = jpegtran ((char*) img_path, (char*) path, trans_code, error);
+
+ return (result == 0);
+}
+
+#endif
diff --git a/libeog/eog-image-jpeg.h b/libeog/eog-image-jpeg.h
index 27bb8f6c..53795516 100644
--- a/libeog/eog-image-jpeg.h
+++ b/libeog/eog-image-jpeg.h
@@ -1,6 +1,10 @@
#ifndef _EOG_IMAGE_JPEG_H_
#define _EOG_IMAGE_JPEG_H_
+#include <config.h>
+
+#if HAVE_JPEG
+
#include <glib.h>
#include "eog-image.h"
@@ -9,4 +13,9 @@
gboolean eog_image_jpeg_save (EogImage *image, const char *path, GError **error);
+/* This assumes that image represents a jpeg file on the local filesystem! */
+gboolean eog_image_jpeg_save_lossless (EogImage *image, const char *path, GError **error);
+
+#endif
+
#endif /* _EOG_IMAGE_JPEG_H_ */
diff --git a/libeog/eog-image-private.h b/libeog/eog-image-private.h
index 8017b614..aac78a88 100644
--- a/libeog/eog-image-private.h
+++ b/libeog/eog-image-private.h
@@ -37,6 +37,7 @@ struct _EogImagePrivate {
gint width;
gint height;
GnomeVFSFileSize bytes;
+ char *file_type;
#if HAVE_EXIF
ExifData *exif;
#endif
diff --git a/libeog/eog-image.c b/libeog/eog-image.c
index 4fa6501c..00f0395e 100644
--- a/libeog/eog-image.c
+++ b/libeog/eog-image.c
@@ -19,8 +19,10 @@
#include "eog-image.h"
#include "eog-image-private.h"
#include "eog-pixbuf-util.h"
-#include "eog-image-jpeg.h"
#include "eog-image-cache.h"
+#if HAVE_JPEG
+#include "eog-image-jpeg.h"
+#endif
static GThread *thread = NULL;
static gboolean thread_running = FALSE;
@@ -309,6 +311,11 @@ eog_image_dispose (GObject *object)
priv->caption_key = NULL;
}
+ if (priv->file_type) {
+ g_free (priv->file_type);
+ priv->file_type = NULL;
+ }
+
if (priv->status_mutex) {
g_mutex_free (priv->status_mutex);
priv->status_mutex = NULL;
@@ -746,6 +753,10 @@ real_image_load (gpointer data)
g_warning ("exif data not freed\n");
}
#endif
+ if (priv->file_type != NULL) {
+ g_free (priv->file_type);
+ priv->file_type = NULL;
+ }
result = gnome_vfs_open_uri (&handle, priv->uri, GNOME_VFS_OPEN_READ);
if (result != GNOME_VFS_OK) {
@@ -873,6 +884,7 @@ real_image_load (gpointer data)
GdkPixbuf *image;
GdkPixbuf *transformed = NULL;
EogTransform *trans;
+ GdkPixbufFormat *format;
g_mutex_lock (priv->status_mutex);
image = priv->image;
@@ -897,6 +909,10 @@ real_image_load (gpointer data)
priv->image = image;
priv->width = gdk_pixbuf_get_width (priv->image);
priv->height = gdk_pixbuf_get_height (priv->image);
+ format = gdk_pixbuf_loader_get_format (loader);
+ if (format != NULL) {
+ priv->file_type = g_strdup (gdk_pixbuf_format_get_name (format));
+ }
#if HAVE_EXIF
update_exif_data (img);
#endif
@@ -1194,15 +1210,78 @@ eog_image_undo (EogImage *img)
priv->modified = (priv->undo_stack != NULL);
}
+/* is_local_uri:
+ *
+ * Checks if the URI points to a local file system. This tests simply
+ * if the URI scheme is 'file'. This function is used to ensure that
+ * we can write to the path-part of the URI with non-VFS aware
+ * filesystem calls.
+ */
+static gboolean
+is_local_uri (const GnomeVFSURI* uri)
+{
+ const char *scheme;
+
+ g_return_val_if_fail (uri != NULL, FALSE);
+
+ scheme = gnome_vfs_uri_get_scheme (uri);
+ return (g_strcasecmp (scheme, "file") == 0);
+}
+
+static char*
+get_save_file_type_by_suffix (const char *local_path)
+{
+ GSList *savable_formats = NULL;
+ GSList *it;
+ char *file_type = NULL;
+ char *suffix;
+ GdkPixbufFormat *format;
+ char **extension;
+ int i;
+
+ /* FIXME: this is probably not unicode friendly */
+ suffix = g_strrstr (local_path, ".");
+ if (suffix == NULL) {
+ return NULL;
+ }
+
+ /* skip '.' from the suffix string */
+ if (strlen (suffix) > 1) {
+ suffix++;
+ }
+
+ savable_formats = eog_pixbuf_get_savable_formats ();
+
+ /* iterate over the availabe formats and check for every
+ * possible format suffix if it matches the file suffix */
+ for (it = savable_formats; it != NULL && file_type == NULL; it = it->next) {
+
+ format = (GdkPixbufFormat*) it->data;
+ extension = gdk_pixbuf_format_get_extensions (format);
+
+ for (i = 0; extension[i] != NULL && file_type == NULL; i++) {
+ if (g_ascii_strcasecmp (extension[i], suffix) == 0) {
+ file_type = gdk_pixbuf_format_get_name (format);
+ }
+ }
+
+ g_strfreev (extension);
+ }
+ g_slist_free (savable_formats);
+
+ /* file_type is either NULL or contains the name of the format */
+ return file_type;
+}
+
gboolean
eog_image_save (EogImage *img, const GnomeVFSURI *uri, GError **error)
{
EogImagePrivate *priv;
char *file;
- char *file_type = NULL;
- GSList *savable_formats = NULL;
- GSList *it;
- gboolean result;
+ char *target_type = NULL;
+ char *source_type = NULL;
+ gboolean result = FALSE;
+ gboolean source_is_local;
g_return_val_if_fail (EOG_IS_IMAGE (img), FALSE);
g_return_val_if_fail (uri != NULL, FALSE);
@@ -1210,6 +1289,7 @@ eog_image_save (EogImage *img, const GnomeVFSURI *uri, GError **error)
priv = img->priv;
+ /* fail if there is no image to save */
if (priv->image == NULL) {
g_set_error (error, EOG_IMAGE_ERROR,
EOG_IMAGE_ERROR_NOT_LOADED,
@@ -1217,69 +1297,94 @@ eog_image_save (EogImage *img, const GnomeVFSURI *uri, GError **error)
return FALSE;
}
-#if 0
- /* FIXME: Why does this not work for local files? */
- if (!gnome_vfs_uri_is_local (uri)) {
+ /* Since we rely on some local system calls resp. non-VFS aware libs,
+ * we can write only to local files.
+ */
+ if (!is_local_uri (uri)) {
g_set_error (error, EOG_IMAGE_ERROR,
EOG_IMAGE_ERROR_NOT_LOADED,
_("Images can only be saved as local files."));
return FALSE;
}
-#endif
/* find file type for saving, according to filename suffix */
- file = (char*) gnome_vfs_uri_get_path (uri); /* don't free file */
-
- savable_formats = eog_pixbuf_get_savable_formats ();
- for (it = savable_formats; it != NULL && file_type == NULL; it = it->next) {
- GdkPixbufFormat *format;
- char **extension;
- int i;
-
- format = (GdkPixbufFormat*) it->data;
- extension = gdk_pixbuf_format_get_extensions (format);
-
- for (i = 0; extension[i] != NULL && file_type == NULL; i++) {
- char *suffix;
-
- suffix = g_strconcat (".", extension[i], NULL);
- if (g_str_has_suffix (file, suffix)) {
- file_type = gdk_pixbuf_format_get_name (format);
- }
-
- g_free (suffix);
- }
-
- g_strfreev (extension);
- }
- g_slist_free (savable_formats);
+ file = (char*) gnome_vfs_uri_get_path (uri); /* don't free file, it's a static string */
- if (file_type == NULL) {
+ target_type = get_save_file_type_by_suffix (file);
+ if (target_type == NULL) {
g_set_error (error, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
_("Unsupported image type for saving."));
return FALSE;
}
+
+ source_is_local = (priv->uri != NULL && is_local_uri (priv->uri));
+ source_type = priv->file_type;
+
+ /* Check for some special cases, so that we use always the least intrusive method
+ * for saving the image.
+ */
+ if ((g_ascii_strcasecmp (target_type, source_type) == 0) &&
+ !eog_image_is_modified (img))
+ {
+ /* If image source and target have the same type and
+ * source is not modified in any way => copy file.
+ */
+ GnomeVFSResult vfs_result;
+
+ vfs_result = gnome_vfs_xfer_uri (priv->uri,
+ uri,
+ GNOME_VFS_XFER_DEFAULT /* copy the data */,
+ GNOME_VFS_XFER_ERROR_MODE_ABORT, /* abort on all errors */
+ GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE, /* we checked for existing
+ file already */
+ NULL, /* no progress callback */
+ NULL);
+ result = (vfs_result == GNOME_VFS_OK);
+ if (!result) {
+ g_set_error (error, EOG_IMAGE_ERROR,
+ EOG_IMAGE_ERROR_VFS,
+ gnome_vfs_result_to_string (vfs_result));
+ }
+ g_print ("copy image file\n");
+ }
+#if HAVE_JPEG
+ else if ((g_ascii_strcasecmp (source_type, "jpeg") == 0) &&
+ (g_ascii_strcasecmp (target_type, "jpeg") == 0) &&
+ source_is_local)
+ {
+ /* If source is a local file and both are jpeg files,
+ * then use lossless transformation through libjpeg.
+ */
+ result = eog_image_jpeg_save_lossless (img, file, error);
+ g_print ("loseless saving of %s to %s\n",
+ gnome_vfs_uri_to_string (priv->uri, GNOME_VFS_URI_HIDE_NONE), file);
+ }
#if HAVE_EXIF
- if ((g_ascii_strcasecmp (file_type, "jpeg") == 0) && priv->exif != NULL) {
+ else if ((g_ascii_strcasecmp (target_type, "jpeg") == 0) && priv->exif != NULL) {
+ /* If the target is a jpeg file and the image has EXIF
+ * information preserve these by saving through
+ * libjpeg.
+ */
result = eog_image_jpeg_save (img, file, error);
}
+#endif
+#endif
else {
- result = gdk_pixbuf_save (priv->image, file, file_type, error, NULL);
+ /* In all other cases: Use default save method
+ * provided by gdk-pixbuf library.
+ */
+ result = gdk_pixbuf_save (priv->image, file, target_type, error, NULL);
}
-#else
- result = gdk_pixbuf_save (priv->image, file, file_type, error, NULL);
-#endif
-
-
+
if (result) {
/* free the transformation since it's not needed anymore */
/* FIXME: You can't undo prev transformations then anymore. */
GList *it = priv->undo_stack;
for (; it != NULL; it = it->next)
g_object_unref (G_OBJECT (it->data));
-
+
g_list_free (priv->undo_stack);
g_object_unref (priv->trans);
priv->trans = NULL;
@@ -1287,7 +1392,7 @@ eog_image_save (EogImage *img, const GnomeVFSURI *uri, GError **error)
priv->modified = FALSE;
}
- g_free (file_type);
+ g_free (target_type);
return result;
}
@@ -1378,9 +1483,6 @@ eog_image_get_caption (EogImage *img)
priv->caption = name;
-
-
-
if (priv->caption == NULL) {
char *short_str;
diff --git a/libeog/eog-transform.c b/libeog/eog-transform.c
index e8304b9a..71369535 100644
--- a/libeog/eog-transform.c
+++ b/libeog/eog-transform.c
@@ -219,7 +219,7 @@ eog_transform_rotate_new (int degree)
}
EogTransform*
-eog_transform_flip_new (EogTransformFlipType type)
+eog_transform_flip_new (EogTransformType type)
{
EogTransform *trans;
gboolean horiz, vert;
@@ -249,3 +249,43 @@ eog_transform_scale_new (double sx, double sy)
return trans;
}
+
+EogTransformType
+eog_transform_get_transform_type (EogTransform *trans)
+{
+ double affine[6];
+ EogTransformPrivate *priv;
+
+ g_return_val_if_fail (EOG_IS_TRANSFORM (trans), EOG_TRANSFORM_NONE);
+
+ priv = trans->priv;
+
+ art_affine_rotate (affine, 90);
+ if (art_affine_equal (affine, priv->affine)) {
+ return EOG_TRANSFORM_ROT_90;
+ }
+
+ art_affine_rotate (affine, 180);
+ if (art_affine_equal (affine, priv->affine)) {
+ return EOG_TRANSFORM_ROT_180;
+ }
+
+ art_affine_rotate (affine, 270);
+ if (art_affine_equal (affine, priv->affine)) {
+ return EOG_TRANSFORM_ROT_270;
+ }
+
+ art_affine_identity (affine);
+ art_affine_flip (affine, affine, TRUE, FALSE);
+ if (art_affine_equal (affine, priv->affine)) {
+ return EOG_TRANSFORM_FLIP_HORIZONTAL;
+ }
+
+ art_affine_identity (affine);
+ art_affine_flip (affine, affine, FALSE, TRUE);
+ if (art_affine_equal (affine, priv->affine)) {
+ return EOG_TRANSFORM_FLIP_VERTICAL;
+ }
+
+ return EOG_TRANSFORM_NONE;
+}
diff --git a/libeog/eog-transform.h b/libeog/eog-transform.h
index 36b1dcf1..d92a9da4 100644
--- a/libeog/eog-transform.h
+++ b/libeog/eog-transform.h
@@ -7,9 +7,13 @@
G_BEGIN_DECLS
typedef enum {
+ EOG_TRANSFORM_NONE,
+ EOG_TRANSFORM_ROT_90,
+ EOG_TRANSFORM_ROT_180,
+ EOG_TRANSFORM_ROT_270,
EOG_TRANSFORM_FLIP_HORIZONTAL,
EOG_TRANSFORM_FLIP_VERTICAL
-} EogTransformFlipType;
+} EogTransformType;
#define EOG_TYPE_TRANSFORM (eog_transform_get_type ())
#define EOG_TRANSFORM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EOG_TYPE_TRANSFORM, EogTransform))
@@ -49,9 +53,11 @@ EogTransform* eog_transform_compose (EogTransform *trans, EogTransform *compose)
gboolean eog_transform_is_identity (EogTransform *trans);
EogTransform* eog_transform_rotate_new (int degree);
-EogTransform* eog_transform_flip_new (EogTransformFlipType type);
+EogTransform* eog_transform_flip_new (EogTransformType type /* only EOG_TRANSFORM_FLIP_* are valid */);
EogTransform* eog_transform_scale_new (double sx, double sy);
+EogTransformType eog_transform_get_transform_type (EogTransform *trans);
+
G_END_DECLS
#endif /* _EOG_TRANSFORM_H_ */
diff --git a/viewer/Makefile.am b/viewer/Makefile.am
index e666b076..bdf4a6c2 100644
--- a/viewer/Makefile.am
+++ b/viewer/Makefile.am
@@ -1,3 +1,8 @@
+if ENABLE_JPEG
+jpeg_LIB = -L$(top_builddir)/jpegutils -leog-jpegutils
+jpeg_DEPS = $(top_builddir)/jpegutils/libeog-jpegutils.a
+endif
+
INCLUDES = \
-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
-DG_LOG_DOMAIN=\"Eog\" \
@@ -21,11 +26,13 @@ eog_image_viewer_SOURCES = \
eog_image_viewer_DEPENDENCIES = \
$(top_builddir)/libeog/libeog.a \
- $(top_builddir)/libgpi/libgpi.a
+ $(top_builddir)/libgpi/libgpi.a \
+ $(jpeg_DEPS)
eog_image_viewer_LDADD = \
-L$(top_builddir)/libeog -leog \
-L$(top_builddir)/libgpi -lgpi \
+ $(jpeg_LIB) \
$(EOG_LIBS) \
$(X_LIBS) \
$(LIBJPEG)