summaryrefslogtreecommitdiff
path: root/src/eom-image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eom-image.c')
-rw-r--r--src/eom-image.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/src/eom-image.c b/src/eom-image.c
index 191acd4..f24b528 100644
--- a/src/eom-image.c
+++ b/src/eom-image.c
@@ -61,9 +61,6 @@
#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
#include <lcms2.h>
-#ifndef EXIF_TAG_GAMMA
-#define EXIF_TAG_GAMMA 0xa500
-#endif
#endif
#ifdef HAVE_RSVG
@@ -84,8 +81,6 @@ enum {
static guint signals[SIGNAL_LAST] = { 0 };
-static GList *supported_mime_types = NULL;
-
#define EOM_IMAGE_READ_BUFFER_SIZE 65535
static void
@@ -705,7 +700,6 @@ eom_image_set_icc_data (EomImage *img, EomMetadataReader *md_reader)
priv->profile = eom_metadata_reader_get_icc_profile (md_reader);
-
}
#endif
@@ -902,7 +896,6 @@ eom_image_real_load (EomImage *img,
gboolean read_only_dimension = (data2read & EOM_IMAGE_DATA_DIMENSION) &&
((data2read ^ EOM_IMAGE_DATA_DIMENSION) == 0);
-
priv = img->priv;
g_assert (!read_image_data || priv->image == NULL);
@@ -961,7 +954,7 @@ eom_image_real_load (EomImage *img,
}
if (!strcmp (mime_type, "image/svg+xml")
-#if LIBRSVG_CHECK_FEATURE(SVGZ)
+#if defined (LIBRSVG_HAVE_SVGZ) && LIBRSVG_HAVE_SVGZ
|| !strcmp (mime_type, "image/svg+xml-compressed")
#endif
) {
@@ -985,8 +978,7 @@ eom_image_real_load (EomImage *img,
loader = gdk_pixbuf_loader_new ();
}
- g_signal_connect_object (G_OBJECT (loader),
- "size-prepared",
+ g_signal_connect_object (loader, "size-prepared",
G_CALLBACK (eom_image_size_prepared),
img,
0);
@@ -1462,8 +1454,7 @@ transfer_progress_cb (goffset cur_bytes,
EomImage *image = EOM_IMAGE (user_data);
if (cur_bytes > 0) {
- g_signal_emit (G_OBJECT(image),
- signals[SIGNAL_SAVE_PROGRESS],
+ g_signal_emit (image, signals[SIGNAL_SAVE_PROGRESS],
0,
(gfloat) cur_bytes / (gfloat) total_bytes);
}
@@ -1885,7 +1876,6 @@ eom_image_save_as_by_info (EomImage *img, EomImageSaveInfo *source, EomImageSave
return success;
}
-
/*
* This function is extracted from
* File: caja/libcaja-private/caja-file.c
@@ -1955,7 +1945,7 @@ eom_image_get_caption (EomImage *img)
/* Guaranteed to be correct utf8 here */
validated = TRUE;
}
- } else if (!broken_filenames) {
+ } else {
/* name was valid, no need to re-validate */
validated = TRUE;
}
@@ -2077,7 +2067,6 @@ eom_image_get_xmp_info (EomImage *img)
return data;
}
-
/**
* eom_image_get_file:
* @img: a #EomImage
@@ -2115,7 +2104,7 @@ eom_image_modified (EomImage *img)
{
g_return_if_fail (EOM_IS_IMAGE (img));
- g_signal_emit (G_OBJECT (img), signals[SIGNAL_CHANGED], 0);
+ g_signal_emit (img, signals[SIGNAL_CHANGED], 0);
}
gchar*
@@ -2217,11 +2206,12 @@ compare_quarks (gconstpointer a, gconstpointer b)
GList *
eom_image_get_supported_mime_types (void)
{
+ static GList *supported_mime_types = NULL;
GSList *format_list, *it;
gchar **mime_types;
int i;
- if (!supported_mime_types) {
+ if (supported_mime_types == NULL) {
format_list = gdk_pixbuf_get_formats ();
for (it = format_list; it != NULL; it = it->next) {
@@ -2249,18 +2239,16 @@ eom_image_get_supported_mime_types (void)
gboolean
eom_image_is_supported_mime_type (const char *mime_type)
{
- GList *supported_mime_types, *result;
+ GList *result;
GQuark quark;
if (mime_type == NULL) {
return FALSE;
}
- supported_mime_types = eom_image_get_supported_mime_types ();
-
quark = g_quark_from_string (mime_type);
- result = g_list_find_custom (supported_mime_types,
+ result = g_list_find_custom (eom_image_get_supported_mime_types (),
GINT_TO_POINTER (quark),
(GCompareFunc) compare_quarks);
@@ -2446,4 +2434,3 @@ eom_image_is_jpeg (EomImage *img)
return ((img->priv->file_type != NULL) && (g_ascii_strcasecmp (img->priv->file_type, EOM_FILE_FORMAT_JPEG) == 0));
}
-