fixed bug 1944, nautilus doesn't thumbnail xpm images, by modifying

fixed bug 1944, nautilus doesn't thumbnail xpm images, by
	modifying nautilus_gdk_pixbuf_load to use gdk_pixbuf_new_from_file
	when the file is local.
This commit is contained in:
Andy Hertzfeld 2000-08-04 19:39:46 +00:00
parent b4917b41d4
commit 9ba8952a06
5 changed files with 41 additions and 8 deletions

View file

@ -1,3 +1,14 @@
2000-08-04 Andy Hertzfeld <andy@eazel.com>
* libnautilus-extensions/nautilus-gdk-pixbuf-extensions.c:
(nautilus_gdk_pixbuf_load):
fixed demo bug #1944, nautilus doesn't thumbnail xpms. Fixed
by making nautilus_gdk_pixbuf_load using
nautilus_gdk_pixbuf_new_from_file for local files, since that
works better than using the loaders.
* libnautilus-extensions/nautilus-icon-factory.c:
removed FIXME that was already fixed.
2000-08-04 Mathieu Lacage <mathieu@eazel.com>
* libnautilus-extensions/nautilus-file-utilities.c:

View file

@ -24,6 +24,7 @@
#include <config.h>
#include <math.h>
#include "nautilus-file-utilities.h"
#include "nautilus-gdk-pixbuf-extensions.h"
#include "nautilus-gdk-extensions.h"
#include "nautilus-glib-extensions.h"
@ -89,12 +90,26 @@ nautilus_gdk_pixbuf_load (const char *uri)
GnomeVFSResult result;
GnomeVFSHandle *handle;
char buffer[LOAD_BUFFER_SIZE];
char *local_path;
GnomeVFSFileSize bytes_read;
GdkPixbufLoader *loader;
GdkPixbuf *pixbuf;
g_return_val_if_fail (uri != NULL, NULL);
/* FIXME #1964: unfortunately, there are bugs in the gdk_pixbuf_loader
stuff that make it not work for various image types like .xpms.
Since gdk_pixbuf_new_from_file uses different, bug-free code,
we call that when the file is local. This should be fixed
(in gdk_pixbuf) eventually, then this hack can be removed */
local_path = nautilus_get_local_path_from_uri (uri);
if (local_path != NULL) {
pixbuf = gdk_pixbuf_new_from_file (local_path);
g_free (local_path);
return pixbuf;
}
result = gnome_vfs_open (&handle,
uri,
GNOME_VFS_OPEN_READ);

View file

@ -2191,10 +2191,6 @@ embedded_text_rect_usable (const ArtIRect *embedded_text_rect)
return TRUE;
}
/* FIXME bugzilla.eazel.com 1613:
* Need to factor out code in nautilus-icon-factory.c:embed_text() into
* nautilus_gdk_pixbuf_draw_text so it can be used elsewhere.
*/
static GdkPixbuf *
embed_text (GdkPixbuf *pixbuf_without_text,
const ArtIRect *embedded_text_rect,

View file

@ -24,6 +24,7 @@
#include <config.h>
#include <math.h>
#include "nautilus-file-utilities.h"
#include "nautilus-gdk-pixbuf-extensions.h"
#include "nautilus-gdk-extensions.h"
#include "nautilus-glib-extensions.h"
@ -89,12 +90,26 @@ nautilus_gdk_pixbuf_load (const char *uri)
GnomeVFSResult result;
GnomeVFSHandle *handle;
char buffer[LOAD_BUFFER_SIZE];
char *local_path;
GnomeVFSFileSize bytes_read;
GdkPixbufLoader *loader;
GdkPixbuf *pixbuf;
g_return_val_if_fail (uri != NULL, NULL);
/* FIXME #1964: unfortunately, there are bugs in the gdk_pixbuf_loader
stuff that make it not work for various image types like .xpms.
Since gdk_pixbuf_new_from_file uses different, bug-free code,
we call that when the file is local. This should be fixed
(in gdk_pixbuf) eventually, then this hack can be removed */
local_path = nautilus_get_local_path_from_uri (uri);
if (local_path != NULL) {
pixbuf = gdk_pixbuf_new_from_file (local_path);
g_free (local_path);
return pixbuf;
}
result = gnome_vfs_open (&handle,
uri,
GNOME_VFS_OPEN_READ);

View file

@ -2191,10 +2191,6 @@ embedded_text_rect_usable (const ArtIRect *embedded_text_rect)
return TRUE;
}
/* FIXME bugzilla.eazel.com 1613:
* Need to factor out code in nautilus-icon-factory.c:embed_text() into
* nautilus_gdk_pixbuf_draw_text so it can be used elsewhere.
*/
static GdkPixbuf *
embed_text (GdkPixbuf *pixbuf_without_text,
const ArtIRect *embedded_text_rect,