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.c71
1 files changed, 6 insertions, 65 deletions
diff --git a/src/eom-image.c b/src/eom-image.c
index 3cd8e34..45e03c8 100644
--- a/src/eom-image.c
+++ b/src/eom-image.c
@@ -483,40 +483,6 @@ eom_image_emit_size_prepared (EomImage *img)
g_object_ref (img), g_object_unref);
}
-static gboolean
-check_loader_threadsafety (GdkPixbufLoader *loader, gboolean *result)
-{
- GdkPixbufFormat *format;
- gboolean ret_val = FALSE;
-
- format = gdk_pixbuf_loader_get_format (loader);
- if (format) {
- ret_val = TRUE;
- if (result)
- /* FIXME: We should not be accessing this struct internals
- * directly. Keep track of bug #469209 to fix that. */
- *result = format->flags & GDK_PIXBUF_FORMAT_THREADSAFE;
- }
-
- return ret_val;
-}
-
-static void
-eom_image_pre_size_prepared (GdkPixbufLoader *loader,
- gint width,
- gint height,
- gpointer data)
-{
- EomImage *img;
-
- eom_debug (DEBUG_IMAGE_LOAD);
-
- g_return_if_fail (EOM_IS_IMAGE (data));
-
- img = EOM_IMAGE (data);
- check_loader_threadsafety (loader, &img->priv->threadsafe_format);
-}
-
static void
eom_image_size_prepared (GdkPixbufLoader *loader,
gint width,
@@ -539,9 +505,7 @@ eom_image_size_prepared (GdkPixbufLoader *loader,
g_mutex_unlock (&img->priv->status_mutex);
#ifdef HAVE_EXIF
- if (img->priv->threadsafe_format && (!img->priv->autorotate || img->priv->exif))
-#else
- if (img->priv->threadsafe_format)
+ if (!img->priv->autorotate || img->priv->exif)
#endif
eom_image_emit_size_prepared (img);
}
@@ -909,8 +873,6 @@ eom_image_real_load (EomImage *img,
priv->file_type = NULL;
}
- priv->threadsafe_format = FALSE;
-
eom_image_get_file_info (img, &priv->bytes, &mime_type, error);
if (error && *error) {
@@ -953,8 +915,6 @@ eom_image_real_load (EomImage *img,
buffer = g_new0 (guchar, EOM_IMAGE_READ_BUFFER_SIZE);
if (read_image_data || read_only_dimension) {
- gboolean checked_threadsafety = FALSE;
-
#ifdef HAVE_RSVG
if (priv->svg != NULL) {
g_object_unref (priv->svg);
@@ -977,21 +937,8 @@ eom_image_real_load (EomImage *img,
*error = NULL;
loader = gdk_pixbuf_loader_new ();
- } else {
- /* The mimetype-based loader should know the
- * format here already. */
- checked_threadsafety = check_loader_threadsafety (loader, &priv->threadsafe_format);
}
- /* This is used to detect non-threadsafe loaders and disable
- * any possible asyncronous task that could bring deadlocks
- * to image loading process. */
- if (!checked_threadsafety)
- g_signal_connect (loader,
- "size-prepared",
- G_CALLBACK (eom_image_pre_size_prepared),
- img);
-
g_signal_connect_object (G_OBJECT (loader),
"size-prepared",
G_CALLBACK (eom_image_size_prepared),
@@ -1049,16 +996,15 @@ eom_image_real_load (EomImage *img,
if (data2read == EOM_IMAGE_DATA_EXIF) {
g_set_error (error,
EOM_IMAGE_ERROR,
- EOM_IMAGE_ERROR_GENERIC,
- _("EXIF not supported for this file format."));
+ EOM_IMAGE_ERROR_GENERIC,
+ _("EXIF not supported for this file format."));
break;
}
- if (priv->threadsafe_format)
- eom_image_emit_size_prepared (img);
+ eom_image_emit_size_prepared (img);
- priv->metadata_status = EOM_IMAGE_METADATA_NOT_AVAILABLE;
- }
+ priv->metadata_status = EOM_IMAGE_METADATA_NOT_AVAILABLE;
+ }
first_run = FALSE;
}
@@ -1152,11 +1098,6 @@ eom_image_real_load (EomImage *img,
}
priv->file_is_changed = FALSE;
-
- /* If it's non-threadsafe loader, then trigger window
- * showing in the end of the process. */
- if (!priv->threadsafe_format)
- eom_image_emit_size_prepared (img);
} else {
/* Some loaders don't report errors correctly.
* Error will be set below. */