Commit ef09f65e authored by Michael J. Chudobiak's avatar Michael J. Chudobiak

Merged changes from trunk, revs 1318:1329


svn path=/branches/vfs-testing/; revision=1330
parent 7018ef06
2007-02-07 Paolo Bacchilega <paobac@cvs.gnome.org>
* src/gth-viewer.c (gth_viewer_exec_pixbuf_op):
* src/gth-browser.c (gth_browser_exec_pixbuf_op):
Ignore a new gth_pixbuf_op when there already one running.
Fixes bug #392632 – crash in gThumb Image Viewer: repeatedly
pressing Ctrl... Patch by manuel
2007-02-07 Paolo Bacchilega <paobac@cvs.gnome.org>
* src/gth-browser-ui.h:
* src/gth-viewer-ui.h:
* src/gth-viewer-actions-entries.h:
* src/gth-browser-actions-entries.h:
* src/gth-viewer.c:
* src/gth-browser.c: removed the info_bar in the viewer window and
in the browser window when the file list is hidden. Added a
'properties' button on the toolbar.
Added a 'zoot to fit width' button in the viewer toolbar.
* libgthumb/gthumb-stock.h:
* libgthumb/gthumb-stock.c: added GTHUMB_STOCK_METADATA
* src/gth-window.c: indentation fix.
* libgthumb/gth-file-list.c: get the mime type only once and only here,
this is used to speed up list loading when slow mime detection is
used, and is also used to avoid to get the image mime type in the
image-loader thread (which is dangerous).
* libgthumb/file-data.c:
* libgthumb/file-data.h: added a mime_type field.
* libgthumb/thumb-loader.c: no need to use the accurate mime detection
system and no need to load a gif image as an animation in the
thumbnail loader.
* libgthumb/image-loader.c: removed an identation level.
* libgthumb/image-loader.h:
* libgthumb/thumb-loader.h: added a mime_type argument to the
[thumb|image]_loader_set_path functions
* src/gthumb-preloader.c:
* src/gth-batch-op.c:
* src/dlg-jpegtran.c:
* src/dlg-duplicates.c:
* src/catalog-web-exporter.c:
* src/dlg-convert.c:
* src/catalog-png-exporter.c:
* libgthumb/print-callbacks.c: updated calls to image_loader_set_path
adding the new mime_type argument (setting the mime_type to NULL for now).
* libgthumb/file-utils.h:
* libgthumb/file-utils.c: function image_is_type is now public
added function can_load_mime_type, removed image_is_gif__accurate.
2007-02-06 Michael J. Chudobiak <mjc@cvs.gnome.org>
* libgthumb/file-utils.c: (gth_pixbuf_animation_new_from_uri):
......
......@@ -50,6 +50,9 @@ file_data_new (const char *path,
fd->mtime = info->mtime;
}
if (info->mime_type != NULL)
fd->mime_type = info->mime_type;
/* The Exif DateTime tag is only recorded on an as-needed basis during
DateTime sorts. The tag in memory is refreshed if the file mtime has
changed, so it is recorded as well. */
......@@ -103,6 +106,9 @@ file_data_update (FileData *fd)
fd->error = FALSE;
fd->thumb = FALSE;
g_free (fd->mime_type);
fd->mime_type = NULL;
escaped = escape_uri (fd->path);
info = gnome_vfs_file_info_new ();
result = gnome_vfs_get_file_info (escaped,
......@@ -125,6 +131,9 @@ file_data_update (FileData *fd)
g_free (fd->utf8_name);
fd->utf8_name = g_filename_to_utf8 (fd->name, -1, 0, 0, 0);
if (info->mime_type != NULL)
fd->mime_type = info->mime_type;
fd->size = info->size;
fd->mtime = info->mtime;
fd->ctime = info->ctime;
......
......@@ -36,6 +36,7 @@ typedef struct {
char *path; /* Full path name. */
const char *name; /* File name only. */
char *utf8_name;
const char *mime_type;
GnomeVFSFileSize size;
time_t ctime;
time_t mtime;
......
......@@ -652,53 +652,55 @@ get_mime_type_from_ext (const char *ext)
}
gboolean
file_is_image_or_video (const gchar *name,
gboolean fast_file_type,
gboolean image_check,
gboolean video_check)
gboolean mime_type_is_image (const char *mime_type)
{
const char *result = NULL;
gboolean is_that_type;
return ( (strstr (mime_type, "image") != NULL)
|| (strcmp (mime_type, "application/x-crw") == 0) );
}
if (fast_file_type) {
char *filename, *n1;
filename = get_sample_name (name);
if (filename == NULL)
return FALSE;
gboolean file_is_image (const gchar *name,
gboolean fast_file_type)
{
const char *mime_type = NULL;
n1 = g_filename_to_utf8 (filename, -1, 0, 0, 0);
if (n1 != NULL) {
char *n2, *n3;
n2 = g_utf8_strdown (n1, -1);
n3 = g_filename_from_utf8 (n2, -1, 0, 0, 0);
mime_type = get_file_mime_type (name, fast_file_type);
if (mime_type == NULL)
return FALSE;
if (n3 != NULL)
result = gnome_vfs_mime_type_from_name_or_default (n3, NULL);
return mime_type_is_image (mime_type);
}
g_free (n3);
g_free (n2);
g_free (n1);
}
} else {
if (uri_scheme_is_file (name))
name = get_file_path_from_uri (name);
result = gnome_vfs_get_file_mime_type (name, NULL, FALSE);
}
/* Unknown file type. */
if (result == NULL)
return FALSE;
gboolean file_is_video (const gchar *name,
gboolean fast_file_type)
{
const char *mime_type = NULL;
/* If the description contains the word 'image' or 'video' then we suppose
* it is an image that gdk-pixbuf can load, or a video that we can refer
to an external program. */
mime_type = get_file_mime_type (name, fast_file_type);
if (mime_type == NULL)
return FALSE;
return ( (((strstr (result, "image") != NULL)
|| (strcmp(result, "application/x-crw") == 0))
&& image_check)
|| ((strstr (result, "video") != NULL) && video_check));
return mime_type_is_video (mime_type);
}
gboolean mime_type_is_video (const char *mime_type)
{
return (strstr (mime_type, "video") != NULL);
}
gboolean file_is_image_or_video (const gchar *name,
gboolean fast_file_type)
{
const char *mime_type = NULL;
mime_type = get_file_mime_type (name, fast_file_type);
if (mime_type == NULL)
return FALSE;
return mime_type_is_image (mime_type) || mime_type_is_video (mime_type);
}
......@@ -799,6 +801,9 @@ get_file_mime_type (const char *name,
{
const char *result = NULL;
if (name == NULL)
return NULL;
if (fast_file_type) {
char *n1 = g_filename_to_utf8 (name, -1, 0, 0, 0);
if (n1 != NULL) {
......@@ -817,10 +822,18 @@ get_file_mime_type (const char *name,
}
static gboolean
image_is_type__common (const char *name,
const char *type,
gboolean fast_file_type)
gboolean
mime_type_is (const char *mime_type,
const char *value)
{
return (strcmp_null_tollerant (mime_type, value) == 0);
}
gboolean
image_is_type (const char *name,
const char *type,
gboolean fast_file_type)
{
const char *result = get_file_mime_type (name, fast_file_type);
return (strcmp_null_tollerant (result, type) == 0);
......@@ -828,46 +841,39 @@ image_is_type__common (const char *name,
static gboolean
image_is_type (const char *name,
const char *type)
image_is_type__gconf_file_type (const char *name,
const char *type)
{
return image_is_type__common (name, type, eel_gconf_get_boolean (PREF_FAST_FILE_TYPE, TRUE));
return image_is_type (name, type, eel_gconf_get_boolean (PREF_FAST_FILE_TYPE, TRUE));
}
gboolean
image_is_jpeg (const char *name)
{
return image_is_type (name, "image/jpeg");
return image_is_type__gconf_file_type (name, "image/jpeg");
}
gboolean
image_is_raw (const char *name)
{
return image_is_type (name, "application/x-crw") /* ? */
|| image_is_type (name, "image/x-dcraw") /* dcraw */
|| image_is_type (name, "image/x-minolta-mrw") /* freedesktop.org.xml */
|| image_is_type (name, "image/x-canon-crw") /* freedesktop.org.xml */
|| image_is_type (name, "image/x-nikon-nef") /* freedesktop.org.xml */
|| image_is_type (name, "image/x-kodak-dcr") /* freedesktop.org.xml */
|| image_is_type (name, "image/x-kodak-kdc") /* freedesktop.org.xml */
|| image_is_type (name, "image/x-olympus-orf") /* freedesktop.org.xml */
|| image_is_type (name, "image/x-fuji-raf") /* freedesktop.org.xml */
|| image_is_type (name, "image/x-raw") /* mimelnk */
mime_type_is_raw (const char *mime_type)
{
return mime_type_is (mime_type, "application/x-crw") /* ? */
|| mime_type_is (mime_type, "image/x-dcraw") /* dcraw */
|| mime_type_is (mime_type, "image/x-minolta-mrw") /* freedesktop.org.xml */
|| mime_type_is (mime_type, "image/x-canon-crw") /* freedesktop.org.xml */
|| mime_type_is (mime_type, "image/x-nikon-nef") /* freedesktop.org.xml */
|| mime_type_is (mime_type, "image/x-kodak-dcr") /* freedesktop.org.xml */
|| mime_type_is (mime_type, "image/x-kodak-kdc") /* freedesktop.org.xml */
|| mime_type_is (mime_type, "image/x-olympus-orf") /* freedesktop.org.xml */
|| mime_type_is (mime_type, "image/x-fuji-raf") /* freedesktop.org.xml */
|| mime_type_is (mime_type, "image/x-raw") /* mimelnk */
;
}
gboolean
image_is_gif (const char *name)
{
return image_is_type (name, "image/gif");
}
gboolean
image_is_gif__accurate (const char *name)
{
return image_is_type__common (name, "image/gif", FALSE);
return image_is_type__gconf_file_type (name, "image/gif");
}
......@@ -2380,16 +2386,19 @@ gth_pixbuf_animation_new_from_uri (const char *filename,
gboolean fast_file_type,
gint requested_width_if_used,
gint requested_height_if_used,
GnomeThumbnailFactory *factory)
GnomeThumbnailFactory *factory,
const char *mime_type)
{
GdkPixbufAnimation *animation = NULL;
GdkPixbuf *pixbuf = NULL;
char *local_file = NULL;
if (mime_type == NULL)
return NULL;
/* The video thumbnailer can handle VFS URIs directly */
if (file_is_image_or_video (filename, FALSE, FALSE, TRUE)
&& factory != NULL) {
if (mime_type_is_video (mime_type) && factory != NULL) {
pixbuf = gth_pixbuf_new_from_video (filename, factory, error);
if (pixbuf == NULL) return NULL;
animation = gdk_pixbuf_non_anim_new (pixbuf);
......@@ -2397,7 +2406,6 @@ gth_pixbuf_animation_new_from_uri (const char *filename,
return animation;
}
/* gdk_pixbuf and libopenraw do not support VFS URIs directly,
so make a local cache copy of remote files. */
local_file = obtain_local_file (filename);
......@@ -2410,7 +2418,7 @@ gth_pixbuf_animation_new_from_uri (const char *filename,
(Tested with ~ 3.7 MB jpeg files over ssh:// on DSL lines). */
/* Thumbnailing mode is signaled by requested_width_if_used > 0. */
if (image_is_jpeg (local_file) && requested_width_if_used > 0) {
if ( mime_type_is (mime_type, "image/jpeg") && requested_width_if_used > 0) {
pixbuf = f_load_scaled_jpeg (local_file,
requested_width_if_used,
requested_height_if_used,
......@@ -2424,7 +2432,7 @@ gth_pixbuf_animation_new_from_uri (const char *filename,
/* gifs: use gdk_pixbuf_animation_new_from_file */
if (image_is_type__common (local_file, "image/gif", fast_file_type)) {
if ( mime_type_is (mime_type, "image/gif")) {
animation = gdk_pixbuf_animation_new_from_file (local_file, error);
g_free (local_file);
return animation;
......@@ -2432,13 +2440,13 @@ gth_pixbuf_animation_new_from_uri (const char *filename,
#ifdef HAVE_LIBOPENRAW
/* raw thumbnails */
if (image_is_raw (local_file) && (requested_width_if_used > 0))
if (mime_type_is_raw (mime_type) && (requested_width_if_used > 0))
pixbuf = or_gdkpixbuf_extract_thumbnail (local_file, requested_width_if_used);
#endif
/* All other file types, or if previous methods fail: read in a
non-animated pixbuf, and convert to a single-frame animation. */
if (pixbuf == NULL)
if (pixbuf == NULL)
pixbuf = gth_pixbuf_new_from_uri (local_file, error);
if (pixbuf != NULL) {
......
......@@ -64,19 +64,19 @@ typedef struct {
PathListData * path_list_data_new (void);
void path_list_data_free (PathListData *dli);
void path_list_handle_free (PathListHandle *handle);
PathListHandle * path_list_async_new (const char *uri,
PathListHandle * path_list_async_new (const char *uri,
PathListDoneFunc f,
gpointer data);
void path_list_async_interrupt (PathListHandle *handle,
DoneFunc f,
gpointer data);
gboolean path_list_new (const char *path,
GList **files,
gboolean path_list_new (const char *path,
GList **files,
GList **dirs);
GList * path_list_dup (GList *path_list);
void path_list_free (GList *list);
void path_list_print (GList *list);
GList * path_list_find_path (GList *list,
GList * path_list_find_path (GList *list,
const char *path);
/* Directory utils */
......@@ -101,24 +101,32 @@ gboolean visit_rc_directory_sync (const char *rc_dir,
VisitFunc do_something,
gpointer data);
/* File utils */
/* File utils */
gboolean file_is_image_or_video (const gchar *name,
gboolean fast_file_type,
gboolean image_check,
gboolean video_check);
gboolean mime_type_is_image (const char *mime_type);
gboolean mime_type_is_video (const char *mime_type);
gboolean file_is_image (const gchar *name,
gboolean fast_file_type);
gboolean file_is_video (const gchar *name,
gboolean fast_file_type);
gboolean file_is_image_or_video (const gchar *name,
gboolean fast_file_type);
gboolean file_is_hidden (const char *name);
gboolean file_copy (const char *from,
gboolean file_copy (const char *from,
const char *to);
gboolean file_move (const char *from,
gboolean file_move (const char *from,
const char *to);
gboolean file_rename (const gchar *old_path,
const gchar *new_path);
gboolean file_unlink (const char *path);
gboolean mime_type_is (const char *mime_type,
const char *value);
gboolean image_is_type (const char *name,
const char *type,
gboolean fast_file_type);
gboolean image_is_jpeg (const char *name);
gboolean image_is_raw (const char *name);
gboolean mime_type_is_raw (const char *name);
gboolean image_is_gif (const char *name);
gboolean image_is_gif__accurate (const char *name);
gboolean path_is_file (const char *s);
gboolean path_is_dir (const char *s);
GnomeVFSFileSize get_file_size (const char *s);
......@@ -150,7 +158,7 @@ int uricmp (const char *uri1,
gboolean same_uri (const char *uri1,
const char *uri2);
char * get_path_relative_to_dir (const char *filename,
char * get_path_relative_to_dir (const char *filename,
const char *destdir);
char * remove_level_from_path (const char *path);
......@@ -166,7 +174,7 @@ gboolean uri_is_root (const char *uri);
/* Catalogs */
char * get_catalog_full_path (const char *relative_path);
gboolean delete_catalog_dir (const char *full_path,
gboolean delete_catalog_dir (const char *full_path,
gboolean recursive,
GError **error);
gboolean delete_catalog (const char *full_path,
......@@ -181,7 +189,7 @@ char * shell_escape (const char *filename);
/* extesion */
gboolean file_extension_is (const char *filename,
gboolean file_extension_is (const char *filename,
const char *ext);
const char * get_filename_extension (const char *filename);
char * remove_extension_from_path (const char *path);
......@@ -209,7 +217,7 @@ const char* get_file_mime_type (const char *path,
gboolean fast_file_type);
const char * get_mime_type_from_ext (const char *ext);
gboolean is_mime_type_writable (const char *mime_type);
gboolean check_permissions (const char *path,
gboolean check_permissions (const char *path,
int mode);
gboolean is_local_file (const char *filename);
void prune_cache ();
......@@ -225,5 +233,6 @@ GdkPixbufAnimation* gth_pixbuf_animation_new_from_uri (const char *fi
gboolean fast_file_type,
gint requested_width_if_used,
gint requested_height_if_used,
GnomeThumbnailFactory *factory);
GnomeThumbnailFactory *factory,
const char *mime_type);
#endif /* FILE_UTILS_H */
......@@ -310,7 +310,7 @@ gth_file_list_update_current_thumb (GthFileList *file_list)
if (result == GNOME_VFS_OK) {
if (resolved_path != NULL) {
thumb_loader_set_path (file_list->priv->thumb_loader, resolved_path);
thumb_loader_set_path (file_list->priv->thumb_loader, resolved_path, file_list->priv->thumb_fd->mime_type);
thumb_loader_start (file_list->priv->thumb_loader);
error = FALSE;
}
......@@ -772,6 +772,7 @@ typedef struct {
GList *new_list;
GList *filtered;
GList *uri_list;
GHashTable *mime_types;
guint timeout_id;
gboolean doing_thumbs;
gboolean destroyed;
......@@ -789,6 +790,7 @@ get_file_info_data_new (GthFileList *file_list)
file_list->priv->new_list = NULL;
data->filtered = NULL;
data->uri_list = NULL;
data->mime_types = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL);
data->timeout_id = 0;
data->destroyed = FALSE;
......@@ -802,6 +804,8 @@ get_file_info_data_free (GetFileInfoData *data)
if (data == NULL)
return;
g_hash_table_destroy (data->mime_types);
if (data->uri_list != NULL) {
g_list_foreach (data->uri_list,
(GFunc) gnome_vfs_uri_unref,
......@@ -968,6 +972,7 @@ set_list__get_file_info_done_cb (GnomeVFSAsyncHandle *handle,
escaped = gnome_vfs_uri_to_string (info_result->uri, GNOME_VFS_URI_HIDE_NONE);
full_path = gnome_vfs_unescape_string (escaped, "/");
fd = file_data_new (full_path, info_result->file_info);
fd->mime_type = g_hash_table_lookup (gfi_data->mime_types, full_path);
gfi_data->filtered = g_list_prepend (gfi_data->filtered, fd);
g_free (full_path);
......@@ -1002,11 +1007,14 @@ load_new_list (GthFileList *file_list)
for (scan = gfi_data->new_list; scan; scan = scan->next) {
char *full_path = scan->data;
const char *name_only = file_name_from_path (full_path);
const char *mime_type;
GnomeVFSURI *uri;
FileData *fd;
mime_type = get_file_mime_type (full_path, fast_file_type);
if ((! file_list->priv->show_dot_files && file_is_hidden (name_only))
|| ! file_is_image_or_video (full_path, fast_file_type, TRUE, TRUE))
|| ! (mime_type_is_image (mime_type) || mime_type_is_video (mime_type)))
continue;
/* if the image is already present invalidate the thumbnail
......@@ -1014,14 +1022,19 @@ load_new_list (GthFileList *file_list)
fd = gth_file_list_filedata_from_path (file_list, full_path);
if (fd != NULL) {
fd->mime_type = mime_type;
fd->error = FALSE;
fd->thumb = FALSE;
continue;
}
uri = new_uri_from_path (full_path);
if (uri != NULL)
if (uri != NULL) {
gfi_data->uri_list = g_list_prepend (gfi_data->uri_list, uri);
g_hash_table_insert (gfi_data->mime_types,
full_path,
mime_type);
}
}
path_list_free (gfi_data->new_list);
......
......@@ -54,6 +54,7 @@ static struct {
{ GTHUMB_STOCK_INVERT, invert_16_rgba, NULL },
{ GTHUMB_STOCK_LIBRARY, library_19_rgba, NULL },
{ GTHUMB_STOCK_LEVELS, levels_22_rgba, levels_16_rgba },
{ GTHUMB_STOCK_METADATA, preview_data_16_rgba, NULL },
{ GTHUMB_STOCK_MIRROR, mirror_24_rgba, mirror_16_rgba },
{ GTHUMB_STOCK_POSTERIZE, posterize_22_rgba, posterize_16_rgba },
{ GTHUMB_STOCK_REDEYE_REMOVAL, redeye_removal_16_rgba, NULL },
......
......@@ -45,6 +45,7 @@
#define GTHUMB_STOCK_INVERT "gthumb-invert"
#define GTHUMB_STOCK_LEVELS "gthumb-levels"
#define GTHUMB_STOCK_LIBRARY "gthumb-library"
#define GTHUMB_STOCK_METADATA "gthumb-metadata"
#define GTHUMB_STOCK_MIRROR "gthumb-mirror"
#define GTHUMB_STOCK_NEXT_IMAGE "gthumb-next-image"
#define GTHUMB_STOCK_POSTERIZE "gthumb-posterize"
......
......@@ -38,8 +38,10 @@
#include "gthumb-marshal.h"
#include "file-utils.h"
#include "glib-utils.h"
#include "gconf-utils.h"
#include "gth-exif-utils.h"
#include "pixbuf-utils.h"
#include "preferences.h"
#define REFRESH_RATE 5
......@@ -56,6 +58,7 @@ struct _ImageLoaderPrivateData {
* GdkPixbufAnimation structure. */
GnomeVFSURI *uri;
const char *mime_type;
GnomeVFSAsyncHandle *info_handle;
......@@ -336,7 +339,7 @@ image_loader_new (const gchar *path,
priv = (ImageLoaderPrivateData*) il->priv;
priv->as_animation = as_animation;
image_loader_set_path (il, path);
image_loader_set_path (il, path, NULL);
priv->thumb_factory = gnome_thumbnail_factory_new (GNOME_THUMBNAIL_SIZE_LARGE);
......@@ -360,7 +363,8 @@ image_loader_set_loader (ImageLoader *il,
void
image_loader_set_path (ImageLoader *il,
const char *path)
const char *path,
const char *mime_type)
{
ImageLoaderPrivateData *priv;
......@@ -370,6 +374,10 @@ image_loader_set_path (ImageLoader *il,
g_mutex_lock (priv->yes_or_no);
if (mime_type == NULL)
mime_type = get_file_mime_type (path, eel_gconf_get_boolean (PREF_FAST_FILE_TYPE, TRUE));
priv->mime_type = mime_type;
if (priv->uri != NULL) {
gnome_vfs_uri_unref (priv->uri);
priv->uri = NULL;
......@@ -383,7 +391,8 @@ image_loader_set_path (ImageLoader *il,
void
image_loader_set_uri (ImageLoader *il,
const GnomeVFSURI *uri)
const GnomeVFSURI *uri,
const char *mime_type)
{
ImageLoaderPrivateData *priv;
......@@ -393,6 +402,8 @@ image_loader_set_uri (ImageLoader *il,
g_mutex_lock (priv->yes_or_no);
priv->mime_type = mime_type;
if (priv->uri != NULL) {
gnome_vfs_uri_unref (priv->uri);
priv->uri = NULL;
......@@ -611,7 +622,7 @@ load_image_thread (void *thread_data)
animation = NULL;
if (path != NULL) {
if (priv->loader != NULL)
animation = (*priv->loader) (path, &error, priv->loader_data);
animation = (*priv->loader) (path, priv->mime_type, &error, priv->loader_data);
else
/* Get an animation. Use slow content-checking to determine
file types. */
......@@ -620,7 +631,8 @@ load_image_thread (void *thread_data)
FALSE,
0,
0,
priv->thumb_factory);
priv->thumb_factory,
priv->mime_type);
}
G_UNLOCK (pixbuf_loader_lock);
......
......@@ -40,7 +40,7 @@ typedef struct _ImageLoader ImageLoader;
typedef struct _ImageLoaderClass ImageLoaderClass;
typedef struct _ImageLoaderPrivateData ImageLoaderPrivateData;
struct _ImageLoader
struct _ImageLoader
{
GObject __parent;
ImageLoaderPrivateData *priv;
......@@ -56,11 +56,11 @@ struct _ImageLoaderClass
void (* image_done) (ImageLoader *il);
void (* image_progress) (ImageLoader *il,
void (* image_progress) (ImageLoader *il,
float percent);
};
typedef GdkPixbufAnimation * (*LoaderFunc) (const char *path, GError **error, gpointer data);
typedef GdkPixbufAnimation * (*LoaderFunc) (const char *path, const char *mime_type, GError **error, gpointer data);
GType image_loader_get_type (void);
......@@ -72,12 +72,14 @@ void image_loader_set_loader (ImageLoader *il,
gpointer data);
void image_loader_set_path (ImageLoader *il,
const gchar *path);
const char *path,
const char *mime_type);
gchar * image_loader_get_path (ImageLoader *il);
void image_loader_set_uri (ImageLoader *il,
const GnomeVFSURI *uri);
const GnomeVFSURI *uri,
const char *mime_type);
GnomeVFSURI * image_loader_get_uri (ImageLoader *il);
......
......@@ -1769,7 +1769,7 @@ typedef struct {
void
load_image__step2 (LoadImageData *lidata)
{
image_loader_set_path (lidata->viewer->loader, lidata->path);
image_loader_set_path (lidata->viewer->loader, lidata->path, NULL);
image_loader_start (lidata->viewer->loader);
g_free (lidata->path);
......
......@@ -1922,7 +1922,7 @@ load_current_image (PrintCatalogDialogData *data)
progress_dialog_set_info (data->pd, msg);
g_free (msg);
image_loader_set_path (data->loader, filename);
image_loader_set_path (data->loader, filename, NULL);
image_loader_start (data->loader);
}
......
......@@ -65,6 +65,7 @@ struct _ThumbLoaderPrivateData
char *uri;
char *e_uri;
const char *mime_type;
gboolean use_cache : 1;
gboolean from_cache : 1;
......@@ -232,6 +233,7 @@ thumb_loader_get_type ()
static GdkPixbufAnimation*
thumb_loader (const char *path,
const char *mime_type,
GError **error,
gpointer data)
{
......@@ -247,7 +249,8 @@ thumb_loader (const char *path,
eel_gconf_get_boolean (PREF_FAST_FILE_TYPE, TRUE),
priv->cache_max_w,
priv->cache_max_h,
priv->thumb_factory);
priv->thumb_factory,
mime_type);
return animation;
}
......@@ -278,7 +281,7 @@ thumb_loader_new (const char *path,
priv->max_h = height;
if (path != NULL)
thumb_loader_set_path (tl, path);
thumb_loader_set_path (tl, path, NULL);
else {
priv->uri = NULL;
priv->e_uri = NULL;
......