diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2006-01-24 23:06:36 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2006-01-24 23:06:36 +0000 |
commit | b95f2f676dff84b38ecbfa8a6a476a1f98b04410 (patch) | |
tree | 8cfe1678c681606e1dde9d603e0757ca01c80677 | |
parent | ab9856c52acf6846d94478e5e8cdcf4d400512c5 (diff) | |
download | netsurf-b95f2f676dff84b38ecbfa8a6a476a1f98b04410.tar.gz netsurf-b95f2f676dff84b38ecbfa8a6a476a1f98b04410.tar.bz2 |
[project @ 2006-01-24 23:06:36 by rjw]
Don't decode GIFs until they are required for rendering.
svn path=/import/netsurf/; revision=2031
-rw-r--r-- | image/gif.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/image/gif.c b/image/gif.c index 4b7fd27ba..8ec0a6ef4 100644 --- a/image/gif.c +++ b/image/gif.c @@ -50,7 +50,6 @@ bool nsgif_create(struct content *c, const char *params[]) { warn_user("NoMemory", 0); return false; } - c->data.gif.current_frame = 0; return true; } @@ -65,7 +64,7 @@ bool nsgif_convert(struct content *c, int iwidth, int iheight) { gif = c->data.gif.gif; gif->gif_data = c->source_data; gif->buffer_size = c->source_size; - gif->buffer_position = 0; // Paranoid + gif->buffer_position = 0; /* Initialise the GIF */ @@ -97,20 +96,13 @@ bool nsgif_convert(struct content *c, int iwidth, int iheight) { c->width = gif->width; c->height = gif->height; c->title = malloc(100); - if (c->title) { + if (c->title) snprintf(c->title, 100, messages_get("GIFTitle"), c->width, c->height, c->source_size); - } c->size += (gif->width * gif->height * 4) + 16 + 44 + 100; - /* Initialise the first frame so if we try to use the image data directly prior to - a plot we get some sensible data - */ - gif_decode_frame(c->data.gif.gif, 0); - if (c->data.gif.gif->frame_image) - bitmap_modified(c->data.gif.gif->frame_image); - /* Schedule the animation if we have one */ + c->data.gif.current_frame = 0; if (gif->frame_count_partial > 1) schedule(gif->frames[0].frame_delay, nsgif_animate, c); |