GNOME Bugzilla – Bug 517276
use gio for thumbnailing
Last modified: 2008-03-16 14:32:35 UTC
In order to thumbnail images from gvfs mounts, such as the upcoming gphoto2 backend for gvfs, the thumbnailing code needs to use gio. Will attach a simple patch that does this. I've also added a small test program to verify that the new code works.
There's one sticky bit here; one of the callbacks returns a GnomeVFSResult (the sync version does no such thing). So to fix this we synthesize one, just returning GNOME_VFS_ERROR_GENERIC if something failed. I think this is OK; libgnomeui is on it's way out anyway and I doubt any application is using this return code anyway.
I've tested this against Nautilus and it works fine. As everybody loves screenshots, here's a screenshot of the new hotness
Thanks for considering this patch.
Created attachment 105525 [details] [review]
- gnome_gdk_pixbuf_new_from_uri_at_scale leaks the GFile in the first early exit.
- input_stream_read_callback doesn't use the error returned by
g_input_stream_read_finish at all. Could just as well pass NULL
- suspicious how the freeing of parts of the handle is split between
free_pixbuf_load_handle and load_done. It looks like
gnome_gdk_pixbuf_new_from_uri_cancel might leak some parts of
handle as a consequence...
Created attachment 105591 [details] [review]
Here is the updated patch that I put in rawhide.
Any chance we can get this patch in? Matthias cleaned up the issues he reported.
Without this patch thumbnailing gphoto2:// and other non-native mounts won't work.
Thanks for considering.
Sorry for not catching this earlier. Commited. Wouldn't it be nice to port all the gnome-vfs stuff in libgnomeui to gio/gvfs or doesn't it matter that we depend on both?
(In reply to comment #5)
> Sorry for not catching this earlier. Commited.
Great, thanks. Will this go on the stable 2.22 branch too?
> Wouldn't it be nice to port all
> the gnome-vfs stuff in libgnomeui to gio/gvfs or doesn't it matter that we
> depend on both?
There's the problem that we return a GnomeVFSResult value in the public API for at least thumbnailing but maybe that could be replaced with a compatible enum. I haven't checked the rest of the API.