After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 517276 - use gio for thumbnailing
use gio for thumbnailing
Status: RESOLVED FIXED
Product: libgnomeui
Classification: Deprecated
Component: general
CVS HEAD
Other Linux
: Normal normal
: future
Assigned To: libgnomeui maintainers
libgnomeui maintainers
Depends on:
Blocks:
 
 
Reported: 2008-02-18 18:22 UTC by David Zeuthen (not reading bugmail)
Modified: 2008-03-16 14:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (14.83 KB, patch)
2008-02-18 18:22 UTC, David Zeuthen (not reading bugmail)
needs-work Details | Review
new patch (14.71 KB, patch)
2008-02-19 18:18 UTC, Matthias Clasen
none Details | Review

Description David Zeuthen (not reading bugmail) 2008-02-18 18:22:18 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

 http://people.freedesktop.org/~david/gphoto2-thumbnails.png

Thanks for considering this patch.
Comment 1 David Zeuthen (not reading bugmail) 2008-02-18 18:22:55 UTC
Created attachment 105525 [details] [review]
Proposed patch
Comment 2 Matthias Clasen 2008-02-18 18:59:42 UTC
Quick 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...

Comment 3 Matthias Clasen 2008-02-19 18:18:05 UTC
Created attachment 105591 [details] [review]
new patch

Here is the updated patch that I put in rawhide.
Comment 4 David Zeuthen (not reading bugmail) 2008-02-28 05:16:56 UTC
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.
Comment 5 Kjartan Maraas 2008-03-16 09:36:16 UTC
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?
Comment 6 David Zeuthen (not reading bugmail) 2008-03-16 14:32:35 UTC
(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.