Re: Patch to make progressive loading optional
John Ellis <[email protected]> Thu, 23 Dec 2004 01:11:24 -0500
| Newsgroups | gmane.comp.gnome.apps.gqview.devel |
|---|---|
| Message-ID | <[email protected]> |
Jon Colverson wrote: > > Hello. I've attached a patch to gqview (1.5.4) that adds an option to > enable or disable progressive loading. I wanted this because I don't > like the visual results during decoding of progressive JPEGs and it > seems that non-progressive decoding is faster (I haven't made any > measurements to back that up). Progressive is a bit slower because it updates the screen after each chunk of data is decoded, the screen updates can make decoding very slow for progressive jpegs and pngs. > The patch adds a gboolean parameter to image_loader_start() to specify > whether the image should be loaded progressively or not. If not, it just > uses gdk_pixbuf_new_from_file() to load the image, and then signals that > it completed if there was no error. This obviously makes the interface > unresponsive during loading. An option like this I would consider, but the unresponsive-while-loading side effect is what I would like to avoid. > Non-progressive loading is only used for loading the current image (not > for preloading, or thumbnails etc.) If the user selects an image that is > already partly pre-loaded, the pre-loading is cancelled and the image is > reloaded non-progressively. > > The diff is a bit hard to read for the part in image_read_ahead_check(), > but it looks more complicated than it is. > > Are you interested in including this patch in GQview? If so, I'll write > the documentation for it. Please try the attached patch (to a clean GQview 1.5.4). Would something like this be sufficient, or is it still too slow? The patch forces delay_flip for all images, the delay_flip ability was introduced as a full screen option in 1.5.2 - this simply enables it everywhere. Greetings, John -- John Ellis <[email protected]> http://gqview.sourceforge.net <GQview> | http://gqapplets.sourceforge.net http://gqmpeg.sourceforge.net <GQmpeg> | <panel applets>
gqview-1.5.4-delayflip.patch
(text/plain, 616 B)
Index: image.c
===================================================================
RCS file: /devel/cvs/gqview/src/image.c,v
retrieving revision 1.109
diff -u -r1.109 image.c
--- image.c 18 Nov 2004 00:18:23 -0000 1.109
+++ image.c 23 Dec 2004 05:56:20 -0000
@@ -3111,6 +3111,8 @@
void image_set_delay_flip(ImageWindow *imd, gint delay)
{
+ delay = TRUE;
+
if (!imd ||
imd->delay_flip == delay) return;
@@ -3233,7 +3235,7 @@
imd->auto_refresh_id = -1;
imd->auto_refresh_interval = -1;
- imd->delay_flip = FALSE;
+ imd->delay_flip = TRUE;
imd->func_update = NULL;
imd->func_complete = NULL;