Commit 980f9d5f authored by Debarshi Ray's avatar Debarshi Ray

Borrow eog-image.[ch], eog-print.[ch] and friends from Eye of GNOME

The following changes were made:
+ removed EogJobModel
+ removed EogJobThumbnail
+ removed thumbnailing code from EogImage
+ replaced Eog marshallers with ones from Photos

eog-image-jpeg.[ch] was left out. It will be used if required in the
future.

New dependencies are:
+ exempi-2.0 >= 1.99.5
+ gtk+-unix-print-3.0
+ lcms2
+ libexif >= 0.6.14
+ librsvg-2.0 >= 2.26.0
+ zlib
parent 1c0cfdd4
......@@ -26,7 +26,10 @@ GLIB_GSETTINGS
CLUTTER_GTK_MIN_VERSION=1.3.2
CLUTTER_MIN_VERSION=1.11
EXEMPI_MIN_VERSION=1.99.5
GLIB_MIN_VERSION=2.28
LIBEXIF_MIN_VERSION=0.6.14
LIBRSVG_MIN_VERSION=2.26.0
GNOME_COMMON_INIT
GNOME_COMPILE_WARNINGS([maximum])
......@@ -43,9 +46,39 @@ AM_GLIB_GNU_GETTEXT
LT_INIT
# ****************************************************************
# Support for nl_langinfo (_NL_MEASUREMENT_MEASUREMENT) (optional)
# ****************************************************************
AC_MSG_CHECKING([for _NL_MEASUREMENT_MEASUREMENT])
AC_TRY_LINK([#include <langinfo.h>], [
char c;
c = *((unsigned char *) nl_langinfo(_NL_MEASUREMENT_MEASUREMENT));
], have_langinfo_measurement=yes, have_langinfo_measurement=no)
AC_MSG_RESULT($have_langinfo_measurement)
if test "$have_langinfo_measurement" = "yes"; then
AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT], [1],
[Define if _NL_MEASUREMENT_MEASUREMENT is available])
fi
# ***************
# ZLIB (required)
# ***************
have_zlib=yes
AC_CHECK_HEADERS([zlib.h],
[AC_CHECK_LIB([z], [inflate],
[AC_CHECK_LIB([z], [crc32], [], [have_zlib=no])],
[have_zlib=no])],
[have_zlib=no])
if test x$have_zlib = xno; then
AC_MSG_ERROR([No sufficient zlib library found on your system.])
fi
PKG_CHECK_MODULES(CAIRO, [cairo])
PKG_CHECK_MODULES(CLUTTER, [clutter-1.0 >= $CLUTTER_MIN_VERSION])
PKG_CHECK_MODULES(CLUTTER_GTK, [clutter-gtk-1.0 >= $CLUTTER_GTK_MIN_VERSION])
PKG_CHECK_MODULES(EXEMPI, [exempi-2.0 >= $EXEMPI_MIN_VERSION])
PKG_CHECK_MODULES(GDK_PIXBUF, [gdk-pixbuf-2.0])
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= $GLIB_MIN_VERSION])
PKG_CHECK_MODULES(GIO, [gio-2.0])
......@@ -57,6 +90,10 @@ PKG_CHECK_MODULES(GOA, [goa-1.0])
AC_DEFINE([GOA_API_IS_SUBJECT_TO_CHANGE], [], [We are aware that GOA's API can change])
PKG_CHECK_MODULES(GTK, [gtk+-3.0])
PKG_CHECK_MODULES(GTK_UNIX_PRINT, [gtk+-unix-print-3.0])
PKG_CHECK_MODULES(LCMS, [lcms2])
PKG_CHECK_MODULES(LIBEXIF, [libexif >= $LIBEXIF_MIN_VERSION])
PKG_CHECK_MODULES(LIBRSVG, [librsvg-2.0 >= $LIBRSVG_MIN_VERSION])
PKG_CHECK_MODULES(TRACKER, [tracker-sparql-0.14])
AC_CONFIG_FILES([
......
......@@ -2,6 +2,11 @@
# Please keep this list sorted alphabetically.
data/gnome-photos.desktop.in.in
data/org.gnome.photos.gschema.xml.in
src/eog-exif-util.c
src/eog-image.c
src/eog-print-image-setup.c
src/eog-uri-converter.c
src/eog-util.c
src/gd-main-toolbar.c
src/photos-application.c
src/photos-load-more-button.c
......
......@@ -15,8 +15,34 @@ gnome_photos_SOURCES = \
$(gnome_photos_built_sources) \
eog-debug.c \
eog-debug.h \
eog-enums.h \
eog-exif-util.c \
eog-exif-util.h \
eog-image.c \
eog-image.h \
eog-image-private.h \
eog-image-save-info.c \
eog-image-save-info.h \
eog-job-queue.c \
eog-job-queue.h \
eog-jobs.c \
eog-jobs.h \
eog-metadata-reader.c \
eog-metadata-reader.h \
eog-metadata-reader-jpg.c \
eog-metadata-reader-jpg.h \
eog-metadata-reader-png.c \
eog-metadata-reader-png.h \
eog-print-image-setup.c \
eog-print-image-setup.h \
eog-print-preview.c \
eog-print-preview.h \
eog-transform.c \
eog-transform.h \
eog-uri-converter.c \
eog-uri-converter.h \
eog-util.c \
eog-util.h \
gd-main-icon-view.c \
gd-main-icon-view.h \
gd-main-list-view.c \
......@@ -124,12 +150,17 @@ AM_CPPFLAGS = \
$(CAIRO_CFLAGS) \
$(CLUTTER_CFLAGS) \
$(CLUTTER_GTK_CFLAGS) \
$(EXEMPI_CFLAGS) \
$(GDK_PIXBUF_CFLAGS) \
$(GIO_CFLAGS) \
$(GLIB_CFLAGS) \
$(GNOME_DESKTOP_CFLAGS) \
$(GOA_CFLAGS) \
$(GTK_CFLAGS) \
$(GTK_UNIX_PRINT_CFLAGS) \
$(LCMS_CFLAGS) \
$(LIBEXIF_CFLAGS) \
$(LIBRSVG_CFLAGS) \
$(TRACKER_CFLAGS) \
$(NULL)
......@@ -139,12 +170,17 @@ gnome_photos_LDADD = \
$(CAIRO_LIBS) \
$(CLUTTER_LIBS) \
$(CLUTTER_GTK_LIBS) \
$(EXEMPI_LIBS) \
$(GDK_PIXBUF_LIBS) \
$(GIO_LIBS) \
$(GLIB_LIBS) \
$(GNOME_DESKTOP_LIBS) \
$(GOA_LIBS) \
$(GTK_LIBS) \
$(GTK_UNIX_PRINT_LIBS) \
$(LCMS_LIBS) \
$(LIBEXIF_LIBS) \
$(LIBRSVG_LIBS) \
$(TRACKER_LIBS) \
$(LIBM) \
$(NULL)
......
/* Eye of GNOME - General enumerations.
*
* Copyright (C) 2007-2008 The Free Software Foundation
*
* Author: Lucas Rocha <lucasr@gnome.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __EOG_ENUMS__
#define __EOG_ENUMS__
typedef enum {
EOG_IMAGE_DATA_IMAGE = 1 << 0,
EOG_IMAGE_DATA_DIMENSION = 1 << 1,
EOG_IMAGE_DATA_EXIF = 1 << 2,
EOG_IMAGE_DATA_XMP = 1 << 3
} EogImageData;
#define EOG_IMAGE_DATA_ALL (EOG_IMAGE_DATA_IMAGE | \
EOG_IMAGE_DATA_DIMENSION | \
EOG_IMAGE_DATA_EXIF | \
EOG_IMAGE_DATA_XMP)
#endif
/* Eye Of Gnome - EXIF Utilities
*
* Copyright (C) 2006-2007 The Free Software Foundation
*
* Author: Lucas Rocha <lucasr@gnome.org>
* Author: Claudio Saavedra <csaavedra@alumnos.utalca.cl>
* Author: Felix Riemann <felix@hsgheli.de>
*
* Based on code by:
* - Jens Finke <jens@gnome.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_STRPTIME
#define _XOPEN_SOURCE
#define _XOPEN_SOURCE_EXTENDED 1
#endif
#include <time.h>
#include "eog-exif-util.h"
#include "eog-util.h"
#include <string.h>
#include <glib/gi18n.h>
#define DATE_BUF_SIZE 200
/* gboolean <-> gpointer conversion macros taken from gedit */
#ifndef GBOOLEAN_TO_POINTER
#define GBOOLEAN_TO_POINTER(i) (GINT_TO_POINTER ((i) ? 2 : 1))
#endif
#ifndef GPOINTER_TO_BOOLEAN
#define GPOINTER_TO_BOOLEAN(i) ((gboolean) ((GPOINTER_TO_INT (i) == 2) ? TRUE : FALSE))
#endif
typedef ExifData EogExifData;
/* Define EogExifData type */
G_DEFINE_BOXED_TYPE(EogExifData, eog_exif_data, eog_exif_data_copy, eog_exif_data_free)
static gpointer
_check_strptime_updates_wday (gpointer data)
{
struct tm tm;
memset (&tm, '\0', sizeof (tm));
strptime ("2008:12:24 20:30:45", "%Y:%m:%d %T", &tm);
/* Check if tm.tm_wday is set to Wednesday (3) now */
return GBOOLEAN_TO_POINTER (tm.tm_wday == 3);
}
/**
* _calculate_wday_yday:
* @tm: A struct tm that should be updated.
*
* Ensure tm_wday and tm_yday are set correctly in a struct tm.
* The other date (dmy) values must have been set already.
**/
static void
_calculate_wday_yday (struct tm *tm)
{
GDate *exif_date;
struct tm tmp_tm;
exif_date = g_date_new_dmy (tm->tm_mday,
tm->tm_mon+1,
tm->tm_year+1900);
g_return_if_fail (exif_date != NULL && g_date_valid (exif_date));
// Use this to get GLib <-> libc corrected values
g_date_to_struct_tm (exif_date, &tmp_tm);
g_date_free (exif_date);
tm->tm_wday = tmp_tm.tm_wday;
tm->tm_yday = tmp_tm.tm_yday;
}
#ifdef HAVE_STRPTIME
static gchar *
eog_exif_util_format_date_with_strptime (const gchar *date)
{
static GOnce strptime_updates_wday = G_ONCE_INIT;
gchar *new_date = NULL;
gchar tmp_date[DATE_BUF_SIZE];
gchar *p;
gsize dlen;
struct tm tm;
memset (&tm, '\0', sizeof (tm));
p = strptime (date, "%Y:%m:%d %T", &tm);
if (p == date + strlen (date)) {
g_once (&strptime_updates_wday,
_check_strptime_updates_wday,
NULL);
// Ensure tm.tm_wday and tm.tm_yday are set
if (!GPOINTER_TO_BOOLEAN (strptime_updates_wday.retval))
_calculate_wday_yday (&tm);
/* A strftime-formatted string, to display the date the image was taken. */
dlen = strftime (tmp_date, DATE_BUF_SIZE * sizeof(gchar), _("%a, %d %B %Y %X"), &tm);
new_date = g_strndup (tmp_date, dlen);
}
return new_date;
}
#else
static gchar *
eog_exif_util_format_date_by_hand (const gchar *date)
{
int year, month, day, hour, minutes, seconds;
int result;
gchar *new_date = NULL;
result = sscanf (date, "%d:%d:%d %d:%d:%d",
&year, &month, &day, &hour, &minutes, &seconds);
if (result < 3 || !g_date_valid_dmy (day, month, year)) {
return NULL;
} else {
gchar tmp_date[DATE_BUF_SIZE];
gsize dlen;
time_t secs;
struct tm tm;
memset (&tm, '\0', sizeof (tm));
tm.tm_mday = day;
tm.tm_mon = month-1;
tm.tm_year = year-1900;
// Calculate tm.tm_wday
_calculate_wday_yday (&tm);
if (result < 5) {
/* A strftime-formatted string, to display the date the image was taken, for the case we don't have the time. */
dlen = strftime (tmp_date, DATE_BUF_SIZE * sizeof(gchar), _("%a, %d %B %Y"), &tm);
} else {
tm.tm_sec = result < 6 ? 0 : seconds;
tm.tm_min = minutes;
tm.tm_hour = hour;
/* A strftime-formatted string, to display the date the image was taken. */
dlen = strftime (tmp_date, DATE_BUF_SIZE * sizeof(gchar), _("%a, %d %B %Y %X"), &tm);
}
if (dlen == 0)
return NULL;
else
new_date = g_strndup (tmp_date, dlen);
}
return new_date;
}
#endif /* HAVE_STRPTIME */
/**
* eog_exif_util_format_date:
* @date: a date string following Exif specifications
*
* Takes a date string formatted after Exif specifications and generates a
* more readable, possibly localized, string out of it.
*
* Returns: a newly allocated date string formatted according to the
* current locale.
*/
gchar *
eog_exif_util_format_date (const gchar *date)
{
gchar *new_date;
#ifdef HAVE_STRPTIME
new_date = eog_exif_util_format_date_with_strptime (date);
#else
new_date = eog_exif_util_format_date_by_hand (date);
#endif /* HAVE_STRPTIME */
return new_date;
}
void
eog_exif_util_set_label_text (GtkLabel *label,
EogExifData *exif_data,
gint tag_id)
{
gchar exif_buffer[512];
const gchar *buf_ptr;
gchar *label_text = NULL;
g_return_if_fail (GTK_IS_LABEL (label));
if (exif_data) {
buf_ptr = eog_exif_data_get_value (exif_data, tag_id,
exif_buffer, 512);
if (tag_id == EXIF_TAG_DATE_TIME_ORIGINAL && buf_ptr)
label_text = eog_exif_util_format_date (buf_ptr);
else
label_text = eog_util_make_valid_utf8 (buf_ptr);
}
gtk_label_set_text (label, label_text);
g_free (label_text);
}
void
eog_exif_util_set_focal_length_label_text (GtkLabel *label,
EogExifData *exif_data)
{
ExifEntry *entry = NULL, *entry35mm = NULL;
ExifByteOrder byte_order;
gfloat f_val = 0.0;
gchar *fl_text = NULL,*fl35_text = NULL;
/* If no ExifData is supplied the label will be
* cleared later as fl35_text is NULL. */
if (exif_data != NULL) {
entry = exif_data_get_entry (exif_data, EXIF_TAG_FOCAL_LENGTH);
entry35mm = exif_data_get_entry (exif_data,
EXIF_TAG_FOCAL_LENGTH_IN_35MM_FILM);
byte_order = exif_data_get_byte_order (exif_data);
}
if (entry && G_LIKELY (entry->format == EXIF_FORMAT_RATIONAL)) {
ExifRational value;
/* Decode value by hand as libexif is not necessarily returning
* it in the format we want it to be.
*/
value = exif_get_rational (entry->data, byte_order);
/* Guard against div by zero */
if (G_LIKELY(value.denominator != 0))
f_val = (gfloat)value.numerator/
(gfloat)value.denominator;
/* TRANSLATORS: This is the actual focal length used when
the image was taken.*/
fl_text = g_strdup_printf (_("%.1f (lens)"), f_val);
}
if (entry35mm && G_LIKELY (entry35mm->format == EXIF_FORMAT_SHORT)) {
ExifShort s_val;
s_val = exif_get_short (entry35mm->data, byte_order);
/* Print as float to get a similar look as above. */
/* TRANSLATORS: This is the equivalent focal length assuming
a 35mm film camera. */
fl35_text = g_strdup_printf(_("%.1f (35mm film)"),(float)s_val);
}
if (fl_text) {
if (fl35_text) {
gchar *merged_txt;
merged_txt = g_strconcat (fl35_text,", ", fl_text, NULL);
gtk_label_set_text (label, merged_txt);
g_free (merged_txt);
} else {
gtk_label_set_text (label, fl_text);
}
} else {
/* This will also clear the label if no ExifData was supplied */
gtk_label_set_text (label, fl35_text);
}
g_free (fl35_text);
g_free (fl_text);
}
/**
* eog_exif_data_get_value:
* @exif_data: pointer to an <structname>ExifData</structname> struct
* @tag_id: the requested tag's id. See <filename>exif-tag.h</filename>
* from the libexif package for possible values (e.g. %EXIF_TAG_EXPOSURE_MODE).
* @buffer: a pre-allocated output buffer
* @buf_size: size of @buffer
*
* Convenience function to extract a string representation of an Exif tag
* directly from an <structname>ExifData</structname> struct. The string is
* written into @buffer as far as @buf_size permits.
*
* Returns: a pointer to @buffer.
*/
const gchar *
eog_exif_data_get_value (EogExifData *exif_data, gint tag_id, gchar *buffer, guint buf_size)
{
ExifEntry *exif_entry;
const gchar *exif_value;
exif_entry = exif_data_get_entry (exif_data, tag_id);
buffer[0] = 0;
exif_value = exif_entry_get_value (exif_entry, buffer, buf_size);
return exif_value;
}
EogExifData *
eog_exif_data_copy (EogExifData *data)
{
exif_data_ref (data);
return data;
}
void
eog_exif_data_free (EogExifData *data)
{
exif_data_unref (data);
}
/* Eye Of Gnome - EXIF Utilities
*
* Copyright (C) 2006-2007 The Free Software Foundation
*
* Author: Lucas Rocha <lucasr@gnome.org>
* Author: Claudio Saavedra <csaavedra@alumnos.utalca.cl>
* Author: Felix Riemann <felix@hsgheli.de>
*
* Based on code by:
* - Jens Finke <jens@gnome.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __EOG_EXIF_UTIL_H__
#define __EOG_EXIF_UTIL_H__
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <libexif/exif-data.h>
G_BEGIN_DECLS
#define EOG_TYPE_EXIF_DATA eog_exif_data_get_type ()
gchar *eog_exif_util_format_date (const gchar *date);
void eog_exif_util_set_label_text (GtkLabel *label,
ExifData *exif_data,
gint tag_id);
void eog_exif_util_set_focal_length_label_text (GtkLabel *label,
ExifData *exif_data);
const gchar *eog_exif_data_get_value (ExifData *exif_data,
gint tag_id, gchar *buffer,
guint buf_size);
GType eog_exif_data_get_type (void) G_GNUC_CONST;
ExifData *eog_exif_data_copy (ExifData *data);
void eog_exif_data_free (ExifData *data);
G_END_DECLS
#endif /* __EOG_EXIF_UTIL_H__ */
/* Eye Of Gnome - Image Private Data
*
* Copyright (C) 2007 The Free Software Foundation
*
* Author: Lucas Rocha <lucasr@gnome.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __EOG_IMAGE_PRIVATE_H__
#define __EOG_IMAGE_PRIVATE_H__
#include "eog-image.h"
#ifdef HAVE_RSVG
#include <librsvg/rsvg.h>
#endif
G_BEGIN_DECLS
struct _EogImagePrivate {
GFile *file;
EogImageStatus status;
EogImageStatus prev_status;
gboolean is_monitored;
EogImageMetadataStatus metadata_status;
GdkPixbuf *image;
GdkPixbufAnimation *anim;
GdkPixbufAnimationIter *anim_iter;
gboolean is_playing;
GdkPixbuf *thumbnail;
#ifdef HAVE_RSVG
RsvgHandle *svg;
#endif
gint width;
gint height;
goffset bytes;
gchar *file_type;
gboolean threadsafe_format;
/* Holds EXIF raw data */
guint exif_chunk_len;
guchar *exif_chunk;
/* Holds IPTC raw data */
guchar *iptc_chunk;
guint iptc_chunk_len;
gboolean modified;
gboolean file_is_changed;
gboolean autorotate;
gint orientation;
#ifdef HAVE_EXIF
ExifData *exif;
#endif
#ifdef HAVE_EXEMPI
XmpPtr xmp;
#endif
#ifdef HAVE_LCMS
cmsHPROFILE profile;
#endif
gchar *caption;
gchar *collate_key;
GMutex status_mutex;
gboolean cancel_loading;
guint data_ref_count;
GSList *undo_stack;
EogTransform *trans;
EogTransform *trans_autorotate;
};
G_END_DECLS
#endif /* __EOG_IMAGE_PRIVATE_H__ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include "eog-image-save-info.h"
#include "eog-image-private.h"
#include "eog-image.h"
#include "photos-utils.h"
G_DEFINE_TYPE (EogImageSaveInfo, eog_image_save_info, G_TYPE_OBJECT)
static void
eog_image_save_info_dispose (GObject *object)
{
EogImageSaveInfo *info = EOG_IMAGE_SAVE_INFO (object);
if (info->file != NULL) {
g_object_unref (info->file);
info->file = NULL;
}
if (info->format != NULL) {
g_free (info->format);
info->format = NULL;
}
G_OBJECT_CLASS (eog_image_save_info_parent_class)->dispose (object);
}
static void
eog_image_save_info_init (EogImageSaveInfo *obj)
{
}
static void
eog_image_save_info_class_init (EogImageSaveInfoClass *klass)
{
GObjectClass *object_class = (GObjectClass*) klass;
object_class->dispose = eog_image_save_info_dispose;
}
/* 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_file (GFile *file)
{
char *scheme;
gboolean ret;
g_return_val_if_fail (file != NULL, FALSE);
scheme = g_file_get_uri_scheme (file);
ret = (g_ascii_strcasecmp (scheme, "file") == 0);
g_free (scheme);
return ret;
}
static char*
get_save_file_type_by_file (GFile *file)
{
GdkPixbufFormat *format;
char *type = NULL;
format = photos_utils_get_pixbuf_format (file);
if (format != NULL) {
type = gdk_pixbuf_format_get_name (format);
}
return type;
}
EogImageSaveInfo*
eog_image_save_info_new_from_image (EogImage *image)
{
EogImageSaveInfo *info = NULL;
g_return_val_if_fail (EOG_IS_IMAGE (image), NULL);
info = g_object_new (EOG_TYPE_IMAGE_SAVE_INFO, NULL);
info->file = eog_image_get_file (image);
info->format = g_strdup (image->priv->file_type);