4 * Copyright (C) 2008 - 2010 The Geeqie Team
8 * This software is released under the GNU General Public License (GNU GPL).
9 * Please read the included file COPYING for more information.
10 * This software comes with no warranty of any kind, use at your own risk!
15 #include "image-load.h"
19 #include "ui_fileops.h"
20 #include "gq-marshal.h"
25 #define IMAGE_LOADER_READ_BUFFER_SIZE_DEFAULT 4096
26 #define IMAGE_LOADER_IDLE_READ_LOOP_COUNT_DEFAULT 1
29 /**************************************************************************************/
30 /* image loader class */
34 SIGNAL_AREA_READY = 0,
42 static guint signals[SIGNAL_COUNT] = { 0 };
44 static void image_loader_init(GTypeInstance *instance, gpointer g_class);
45 static void image_loader_class_init(ImageLoaderClass *class);
46 static void image_loader_finalize(GObject *object);
47 static void image_loader_stop(ImageLoader *il);
49 GType image_loader_get_type(void)
51 static GType type = 0;
54 static const GTypeInfo info = {
55 sizeof(ImageLoaderClass),
57 NULL, /* base_finalize */
58 (GClassInitFunc)image_loader_class_init, /* class_init */
59 NULL, /* class_finalize */
60 NULL, /* class_data */
63 (GInstanceInitFunc)image_loader_init, /* instance_init */
64 NULL /* value_table */
66 type = g_type_register_static(G_TYPE_OBJECT, "ImageLoaderType", &info, 0);
71 static void image_loader_init(GTypeInstance *instance, gpointer g_class)
73 ImageLoader *il = (ImageLoader *)instance;
77 il->idle_priority = G_PRIORITY_DEFAULT_IDLE;
86 il->idle_read_loop_count = IMAGE_LOADER_IDLE_READ_LOOP_COUNT_DEFAULT;
87 il->read_buffer_size = IMAGE_LOADER_READ_BUFFER_SIZE_DEFAULT;
88 il->mapped_file = NULL;
90 il->requested_width = 0;
91 il->requested_height = 0;
94 il->can_destroy = TRUE;
97 il->data_mutex = g_mutex_new();
98 il->can_destroy_cond = g_cond_new();
100 DEBUG_1("new image loader %p, bufsize=%" G_GSIZE_FORMAT " idle_loop=%u", il, il->read_buffer_size, il->idle_read_loop_count);
103 static void image_loader_class_init(ImageLoaderClass *class)
105 GObjectClass *gobject_class = G_OBJECT_CLASS (class);
107 // gobject_class->set_property = image_loader_set_property;
108 // gobject_class->get_property = image_loader_get_property;
110 gobject_class->finalize = image_loader_finalize;
113 signals[SIGNAL_AREA_READY] =
114 g_signal_new("area_ready",
115 G_OBJECT_CLASS_TYPE(gobject_class),
117 G_STRUCT_OFFSET(ImageLoaderClass, area_ready),
119 gq_marshal_VOID__INT_INT_INT_INT,
126 signals[SIGNAL_ERROR] =
127 g_signal_new("error",
128 G_OBJECT_CLASS_TYPE(gobject_class),
130 G_STRUCT_OFFSET(ImageLoaderClass, error),
132 g_cclosure_marshal_VOID__VOID,
135 signals[SIGNAL_DONE] =
137 G_OBJECT_CLASS_TYPE(gobject_class),
139 G_STRUCT_OFFSET(ImageLoaderClass, done),
141 g_cclosure_marshal_VOID__VOID,
144 signals[SIGNAL_PERCENT] =
145 g_signal_new("percent",
146 G_OBJECT_CLASS_TYPE(gobject_class),
148 G_STRUCT_OFFSET(ImageLoaderClass, percent),
150 g_cclosure_marshal_VOID__DOUBLE,
154 signals[SIGNAL_SIZE] =
155 g_signal_new("size_prepared",
156 G_OBJECT_CLASS_TYPE(gobject_class),
158 G_STRUCT_OFFSET(ImageLoaderClass, area_ready),
160 gq_marshal_VOID__INT_INT,
167 static void image_loader_finalize(GObject *object)
169 ImageLoader *il = (ImageLoader *)object;
171 image_loader_stop(il);
173 if (il->error) DEBUG_1("%s", image_loader_get_error(il));
175 DEBUG_1("freeing image loader %p bytes_read=%" G_GSIZE_FORMAT, il, il->bytes_read);
177 if (il->idle_done_id)
179 g_source_remove(il->idle_done_id);
180 il->idle_done_id = 0;
183 while (g_source_remove_by_user_data(il))
185 DEBUG_2("pending signals detected");
188 while (il->area_param_list)
190 DEBUG_1("pending area_ready signals detected");
191 while (g_source_remove_by_user_data(il->area_param_list->data)) {}
192 g_free(il->area_param_list->data);
193 il->area_param_list = g_list_delete_link(il->area_param_list, il->area_param_list);
196 while (il->area_param_delayed_list)
198 g_free(il->area_param_delayed_list->data);
199 il->area_param_delayed_list = g_list_delete_link(il->area_param_delayed_list, il->area_param_delayed_list);
202 if (il->pixbuf) g_object_unref(il->pixbuf);
204 if (il->error) g_error_free(il->error);
206 file_data_unref(il->fd);
208 g_mutex_free(il->data_mutex);
209 g_cond_free(il->can_destroy_cond);
213 void image_loader_free(ImageLoader *il)
216 g_object_unref(G_OBJECT(il));
220 ImageLoader *image_loader_new(FileData *fd)
224 if (!fd) return NULL;
226 il = (ImageLoader *) g_object_new(TYPE_IMAGE_LOADER, NULL);
228 il->fd = file_data_ref(fd);
233 /**************************************************************************************/
234 /* send signals via idle calbacks - the callback are executed in the main thread */
236 typedef struct _ImageLoaderAreaParam ImageLoaderAreaParam;
237 struct _ImageLoaderAreaParam {
246 static gboolean image_loader_emit_area_ready_cb(gpointer data)
248 ImageLoaderAreaParam *par = data;
249 ImageLoader *il = par->il;
250 g_signal_emit(il, signals[SIGNAL_AREA_READY], 0, par->x, par->y, par->w, par->h);
251 g_mutex_lock(il->data_mutex);
252 il->area_param_list = g_list_remove(il->area_param_list, par);
254 g_mutex_unlock(il->data_mutex);
259 static gboolean image_loader_emit_done_cb(gpointer data)
261 ImageLoader *il = data;
262 g_signal_emit(il, signals[SIGNAL_DONE], 0);
266 static gboolean image_loader_emit_error_cb(gpointer data)
268 ImageLoader *il = data;
269 g_signal_emit(il, signals[SIGNAL_ERROR], 0);
273 static gboolean image_loader_emit_percent_cb(gpointer data)
275 ImageLoader *il = data;
276 g_signal_emit(il, signals[SIGNAL_PERCENT], 0, image_loader_get_percent(il));
280 /* DONE and ERROR are emited only once, thus they can have normal priority
281 PERCENT and AREA_READY should be processed ASAP
284 static void image_loader_emit_done(ImageLoader *il)
286 g_idle_add_full(il->idle_priority, image_loader_emit_done_cb, il, NULL);
289 static void image_loader_emit_error(ImageLoader *il)
291 g_idle_add_full(il->idle_priority, image_loader_emit_error_cb, il, NULL);
294 static void image_loader_emit_percent(ImageLoader *il)
296 g_idle_add_full(G_PRIORITY_HIGH, image_loader_emit_percent_cb, il, NULL);
299 /* this function expects that il->data_mutex is locked by caller */
300 static void image_loader_emit_area_ready(ImageLoader *il, guint x, guint y, guint w, guint h)
302 ImageLoaderAreaParam *par = g_new0(ImageLoaderAreaParam, 1);
309 il->area_param_list = g_list_prepend(il->area_param_list, par);
311 g_idle_add_full(G_PRIORITY_HIGH, image_loader_emit_area_ready_cb, par, NULL);
314 /**************************************************************************************/
315 /* the following functions may be executed in separate thread */
317 /* this function expects that il->data_mutex is locked by caller */
318 static void image_loader_queue_delayed_erea_ready(ImageLoader *il, guint x, guint y, guint w, guint h)
320 ImageLoaderAreaParam *par = g_new0(ImageLoaderAreaParam, 1);
327 il->area_param_delayed_list = g_list_prepend(il->area_param_delayed_list, par);
332 static gboolean image_loader_get_stopping(ImageLoader *il)
335 if (!il) return FALSE;
337 g_mutex_lock(il->data_mutex);
339 g_mutex_unlock(il->data_mutex);
345 static void image_loader_sync_pixbuf(ImageLoader *il)
349 g_mutex_lock(il->data_mutex);
353 g_mutex_unlock(il->data_mutex);
357 pb = gdk_pixbuf_loader_get_pixbuf(il->loader);
359 if (pb == il->pixbuf)
361 g_mutex_unlock(il->data_mutex);
365 if (g_ascii_strcasecmp(".jps", il->fd->extension) == 0)
367 g_object_set_data(G_OBJECT(pb), "stereo_data", GINT_TO_POINTER(STEREO_PIXBUF_CROSS));
370 if (il->pixbuf) g_object_unref(il->pixbuf);
373 if (il->pixbuf) g_object_ref(il->pixbuf);
375 g_mutex_unlock(il->data_mutex);
378 static void image_loader_area_updated_cb(GdkPixbufLoader *loader,
379 guint x, guint y, guint w, guint h,
382 ImageLoader *il = data;
384 if (!image_loader_get_pixbuf(il))
386 image_loader_sync_pixbuf(il);
387 if (!image_loader_get_pixbuf(il))
389 log_printf("critical: area_ready signal with NULL pixbuf (out of mem?)\n");
393 g_mutex_lock(il->data_mutex);
394 if (il->delay_area_ready)
395 image_loader_queue_delayed_erea_ready(il, x, y, w, h);
397 image_loader_emit_area_ready(il, x, y, w, h);
398 g_mutex_unlock(il->data_mutex);
401 static void image_loader_area_prepared_cb(GdkPixbufLoader *loader, gpointer data)
408 http://bugzilla.gnome.org/show_bug.cgi?id=547669
409 http://bugzilla.gnome.org/show_bug.cgi?id=589334
411 gchar *format = gdk_pixbuf_format_get_name(gdk_pixbuf_loader_get_format(loader));
412 if (strcmp(format, "svg") == 0 ||
413 strcmp(format, "xpm") == 0)
421 pb = gdk_pixbuf_loader_get_pixbuf(loader);
423 h = gdk_pixbuf_get_height(pb);
424 rs = gdk_pixbuf_get_rowstride(pb);
425 pix = gdk_pixbuf_get_pixels(pb);
427 memset(pix, 0, rs * h); /*this should be faster than pixbuf_fill */
431 static void image_loader_size_cb(GdkPixbufLoader *loader,
432 gint width, gint height, gpointer data)
434 ImageLoader *il = data;
435 GdkPixbufFormat *format;
437 gboolean scale = FALSE;
440 g_mutex_lock(il->data_mutex);
441 if (il->requested_width < 1 || il->requested_height < 1)
443 g_mutex_unlock(il->data_mutex);
444 g_signal_emit(il, signals[SIGNAL_SIZE], 0, width, height);
447 g_mutex_unlock(il->data_mutex);
449 format = gdk_pixbuf_loader_get_format(loader);
452 mime_types = gdk_pixbuf_format_get_mime_types(format);
454 while (mime_types[n])
456 if (strstr(mime_types[n], "jpeg")) scale = TRUE;
459 g_strfreev(mime_types);
463 g_signal_emit(il, signals[SIGNAL_SIZE], 0, width, height);
467 g_mutex_lock(il->data_mutex);
470 if (width > il->requested_width || height > il->requested_height)
473 if (((gdouble)il->requested_width / width) < ((gdouble)il->requested_height / height))
475 nw = il->requested_width;
476 nh = (gdouble)nw / width * height;
481 nh = il->requested_height;
482 nw = (gdouble)nh / height * width;
486 gdk_pixbuf_loader_set_size(loader, nw, nh);
489 g_mutex_unlock(il->data_mutex);
491 g_signal_emit(il, signals[SIGNAL_SIZE], 0, nw, nh);
494 static void image_loader_stop_loader(ImageLoader *il)
500 /* some loaders do not have a pixbuf till close, order is important here */
501 gdk_pixbuf_loader_close(il->loader, il->error ? NULL : &il->error); /* we are interested in the first error only */
502 image_loader_sync_pixbuf(il);
503 g_object_unref(G_OBJECT(il->loader));
506 g_mutex_lock(il->data_mutex);
508 g_mutex_unlock(il->data_mutex);
511 static void image_loader_setup_loader(ImageLoader *il)
513 g_mutex_lock(il->data_mutex);
514 il->loader = gdk_pixbuf_loader_new();
516 g_signal_connect(G_OBJECT(il->loader), "area_updated",
517 G_CALLBACK(image_loader_area_updated_cb), il);
518 g_signal_connect(G_OBJECT(il->loader), "size_prepared",
519 G_CALLBACK(image_loader_size_cb), il);
520 g_signal_connect(G_OBJECT(il->loader), "area_prepared",
521 G_CALLBACK(image_loader_area_prepared_cb), il);
522 g_mutex_unlock(il->data_mutex);
526 static void image_loader_done(ImageLoader *il)
528 image_loader_stop_loader(il);
530 image_loader_emit_done(il);
533 static void image_loader_error(ImageLoader *il)
535 image_loader_stop_loader(il);
537 DEBUG_1("pixbuf_loader reported load error for: %s", il->fd->path);
539 image_loader_emit_error(il);
542 static gboolean image_loader_continue(ImageLoader *il)
547 if (!il) return FALSE;
549 c = il->idle_read_loop_count ? il->idle_read_loop_count : 1;
550 while (c > 0 && !image_loader_get_stopping(il))
552 b = MIN(il->read_buffer_size, il->bytes_total - il->bytes_read);
556 image_loader_done(il);
560 if (b < 0 || (b > 0 && !gdk_pixbuf_loader_write(il->loader, il->mapped_file + il->bytes_read, b, &il->error)))
562 image_loader_error(il);
571 if (il->bytes_total > 0)
573 image_loader_emit_percent(il);
579 static gboolean image_loader_begin(ImageLoader *il)
583 if (il->pixbuf) return FALSE;
585 b = MIN(il->read_buffer_size, il->bytes_total - il->bytes_read);
586 if (b < 1) return FALSE;
588 image_loader_setup_loader(il);
590 if (!gdk_pixbuf_loader_write(il->loader, il->mapped_file + il->bytes_read, b, &il->error))
592 image_loader_stop_loader(il);
598 /* read until size is known */
599 while (il->loader && !gdk_pixbuf_loader_get_pixbuf(il->loader) && b > 0 && !image_loader_get_stopping(il))
601 b = MIN(il->read_buffer_size, il->bytes_total - il->bytes_read);
602 if (b < 0 || (b > 0 && !gdk_pixbuf_loader_write(il->loader, il->mapped_file + il->bytes_read, b, &il->error)))
604 image_loader_stop_loader(il);
609 if (!il->pixbuf) image_loader_sync_pixbuf(il);
611 if (il->bytes_read == il->bytes_total || b < 1)
613 /* done, handle (broken) loaders that do not have pixbuf till close */
614 image_loader_stop_loader(il);
616 if (!il->pixbuf) return FALSE;
618 image_loader_done(il);
624 image_loader_stop_loader(il);
631 /**************************************************************************************/
632 /* the following functions are always executed in the main thread */
635 static gboolean image_loader_setup_source(ImageLoader *il)
640 if (!il || il->loader || il->mapped_file) return FALSE;
642 il->mapped_file = NULL;
646 ExifData *exif = exif_read_fd(il->fd);
648 if (options->thumbnails.use_exif)
649 il->mapped_file = exif_get_preview(exif, (guint *)&il->bytes_total, il->requested_width, il->requested_height);
651 il->mapped_file = exif_get_preview(exif, (guint *)&il->bytes_total, 0, 0); /* get the largest available preview image or NULL for normal images*/
656 DEBUG_1("Usable reduced size (preview) image loaded from file %s", il->fd->path);
658 exif_free_fd(il->fd, exif);
662 if (!il->mapped_file)
667 pathl = path_from_utf8(il->fd->path);
668 load_fd = open(pathl, O_RDONLY | O_NONBLOCK);
670 if (load_fd == -1) return FALSE;
672 if (fstat(load_fd, &st) == 0)
674 il->bytes_total = st.st_size;
682 il->mapped_file = mmap(0, il->bytes_total, PROT_READ|PROT_WRITE, MAP_PRIVATE, load_fd, 0);
684 if (il->mapped_file == MAP_FAILED)
695 static void image_loader_stop_source(ImageLoader *il)
703 exif_free_preview(il->mapped_file);
707 munmap(il->mapped_file, il->bytes_total);
709 il->mapped_file = NULL;
713 static void image_loader_stop(ImageLoader *il)
719 g_source_remove(il->idle_id);
725 /* stop loader in the other thread */
726 g_mutex_lock(il->data_mutex);
728 while (!il->can_destroy) g_cond_wait(il->can_destroy_cond, il->data_mutex);
729 g_mutex_unlock(il->data_mutex);
732 image_loader_stop_loader(il);
733 image_loader_stop_source(il);
737 void image_loader_delay_area_ready(ImageLoader *il, gboolean enable)
739 g_mutex_lock(il->data_mutex);
740 il->delay_area_ready = enable;
745 list = g_list_reverse(il->area_param_delayed_list);
746 il->area_param_delayed_list = NULL;
747 g_mutex_unlock(il->data_mutex);
753 ImageLoaderAreaParam *par = work->data;
756 g_signal_emit(il, signals[SIGNAL_AREA_READY], 0, par->x, par->y, par->w, par->h);
764 g_mutex_unlock(il->data_mutex);
769 /**************************************************************************************/
770 /* execution via idle calls */
772 static gboolean image_loader_idle_cb(gpointer data)
774 gboolean ret = FALSE;
775 ImageLoader *il = data;
779 ret = image_loader_continue(il);
784 image_loader_stop_source(il);
791 static gboolean image_loader_start_idle(ImageLoader *il)
795 if (!il) return FALSE;
797 if (!il->fd) return FALSE;
799 if (!image_loader_setup_source(il)) return FALSE;
801 ret = image_loader_begin(il);
803 if (ret && !il->done) il->idle_id = g_idle_add_full(il->idle_priority, image_loader_idle_cb, il, NULL);
807 /**************************************************************************************/
808 /* execution via thread */
811 static GThreadPool *image_loader_thread_pool = NULL;
813 static GCond *image_loader_prio_cond = NULL;
814 static GMutex *image_loader_prio_mutex = NULL;
815 static gint image_loader_prio_num = 0;
818 static void image_loader_thread_enter_high(void)
820 g_mutex_lock(image_loader_prio_mutex);
821 image_loader_prio_num++;
822 g_mutex_unlock(image_loader_prio_mutex);
825 static void image_loader_thread_leave_high(void)
827 g_mutex_lock(image_loader_prio_mutex);
828 image_loader_prio_num--;
829 if (image_loader_prio_num == 0) g_cond_broadcast(image_loader_prio_cond); /* wake up all low prio threads */
830 g_mutex_unlock(image_loader_prio_mutex);
833 static void image_loader_thread_wait_high(void)
835 g_mutex_lock(image_loader_prio_mutex);
836 while (image_loader_prio_num)
838 g_cond_wait(image_loader_prio_cond, image_loader_prio_mutex);
841 g_mutex_unlock(image_loader_prio_mutex);
845 static void image_loader_thread_run(gpointer data, gpointer user_data)
847 ImageLoader *il = data;
851 if (il->idle_priority > G_PRIORITY_DEFAULT_IDLE)
853 /* low prio, wait untill high prio tasks finishes */
854 image_loader_thread_wait_high();
859 image_loader_thread_enter_high();
862 err = !image_loader_begin(il);
867 loader failed, we have to send signal
868 (idle mode returns the image_loader_begin return value directly)
869 (success is always reported indirectly from image_loader_begin)
871 image_loader_emit_error(il);
876 while (cont && !image_loader_get_is_done(il) && !image_loader_get_stopping(il))
878 if (il->idle_priority > G_PRIORITY_DEFAULT_IDLE)
880 /* low prio, wait untill high prio tasks finishes */
881 image_loader_thread_wait_high();
883 cont = image_loader_continue(il);
885 image_loader_stop_loader(il);
887 if (il->idle_priority <= G_PRIORITY_DEFAULT_IDLE)
890 image_loader_thread_leave_high();
893 g_mutex_lock(il->data_mutex);
894 il->can_destroy = TRUE;
895 g_cond_signal(il->can_destroy_cond);
896 g_mutex_unlock(il->data_mutex);
901 static gboolean image_loader_start_thread(ImageLoader *il)
903 if (!il) return FALSE;
905 if (!il->fd) return FALSE;
909 if (!image_loader_setup_source(il)) return FALSE;
911 if (!image_loader_thread_pool)
913 image_loader_thread_pool = g_thread_pool_new(image_loader_thread_run, NULL, -1, FALSE, NULL);
914 image_loader_prio_cond = g_cond_new();
915 image_loader_prio_mutex = g_mutex_new();
918 il->can_destroy = FALSE; /* ImageLoader can't be freed until image_loader_thread_run finishes */
920 g_thread_pool_push(image_loader_thread_pool, il, NULL);
921 DEBUG_1("Thread pool num threads: %d", g_thread_pool_get_num_threads(image_loader_thread_pool));
925 #endif /* HAVE_GTHREAD */
928 /**************************************************************************************/
929 /* public interface */
932 gboolean image_loader_start(ImageLoader *il)
934 if (!il) return FALSE;
936 if (!il->fd) return FALSE;
939 return image_loader_start_thread(il);
941 return image_loader_start_idle(il);
946 /* don't forget to gdk_pixbuf_ref() it if you want to use it after image_loader_free() */
947 GdkPixbuf *image_loader_get_pixbuf(ImageLoader *il)
950 if (!il) return NULL;
952 g_mutex_lock(il->data_mutex);
954 g_mutex_unlock(il->data_mutex);
958 gchar *image_loader_get_format(ImageLoader *il)
960 GdkPixbufFormat *format;
964 if (!il || !il->loader) return NULL;
966 format = gdk_pixbuf_loader_get_format(il->loader);
967 if (!format) return NULL;
969 mimev = gdk_pixbuf_format_get_mime_types(format);
970 if (!mimev) return NULL;
972 /* return first member of mimev, as GdkPixbufLoader has no way to tell us which exact one ? */
973 mime = g_strdup(mimev[0]);
979 void image_loader_set_requested_size(ImageLoader *il, gint width, gint height)
983 g_mutex_lock(il->data_mutex);
984 il->requested_width = width;
985 il->requested_height = height;
986 g_mutex_unlock(il->data_mutex);
989 void image_loader_set_buffer_size(ImageLoader *il, guint count)
993 g_mutex_lock(il->data_mutex);
994 il->idle_read_loop_count = count ? count : 1;
995 g_mutex_unlock(il->data_mutex);
998 void image_loader_set_priority(ImageLoader *il, gint priority)
1002 if (il->thread) return; /* can't change prio if the thread already runs */
1003 il->idle_priority = priority;
1007 gdouble image_loader_get_percent(ImageLoader *il)
1010 if (!il) return 0.0;
1012 g_mutex_lock(il->data_mutex);
1013 if (il->bytes_total == 0)
1019 ret = (gdouble)il->bytes_read / il->bytes_total;
1021 g_mutex_unlock(il->data_mutex);
1025 gboolean image_loader_get_is_done(ImageLoader *il)
1028 if (!il) return FALSE;
1030 g_mutex_lock(il->data_mutex);
1032 g_mutex_unlock(il->data_mutex);
1037 FileData *image_loader_get_fd(ImageLoader *il)
1040 if (!il) return NULL;
1042 g_mutex_lock(il->data_mutex);
1044 g_mutex_unlock(il->data_mutex);
1049 gboolean image_loader_get_shrunk(ImageLoader *il)
1052 if (!il) return FALSE;
1054 g_mutex_lock(il->data_mutex);
1056 g_mutex_unlock(il->data_mutex);
1060 const gchar *image_loader_get_error(ImageLoader *il)
1062 const gchar *ret = NULL;
1063 if (!il) return NULL;
1064 g_mutex_lock(il->data_mutex);
1065 if (il->error) ret = il->error->message;
1066 g_mutex_unlock(il->data_mutex);
1071 /* FIXME - this can be rather slow and blocks until the size is known */
1072 gboolean image_load_dimensions(FileData *fd, gint *width, gint *height)
1077 il = image_loader_new(fd);
1079 success = image_loader_start_idle(il);
1081 if (success && il->pixbuf)
1083 if (width) *width = gdk_pixbuf_get_width(il->pixbuf);
1084 if (height) *height = gdk_pixbuf_get_height(il->pixbuf);;
1088 if (width) *width = -1;
1089 if (height) *height = -1;
1092 image_loader_free(il);
1096 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */