Add a shortcut to stop the gif mainloop after the first frame, if that is
2006-03-14 Matthias Clasen <mclasen@redhat.com> * io-gif.c (gdk_pixbuf__gif_image_load): Add a shortcut to stop the gif mainloop after the first frame, if that is all we are interested in. (#334538)
This commit is contained in:
parent
f50363d3fa
commit
33b9a8d19b
@ -1,3 +1,9 @@
|
||||
2006-03-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* io-gif.c (gdk_pixbuf__gif_image_load): Add a shortcut
|
||||
to stop the gif mainloop after the first frame, if that
|
||||
is all we are interested in. (#334538)
|
||||
|
||||
2006-03-03 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* io-pnm.c: Support pnm files with maxval > 255.
|
||||
|
@ -117,6 +117,7 @@ struct _GifContext
|
||||
unsigned int global_bit_pixel;
|
||||
unsigned int global_color_resolution;
|
||||
unsigned int background_index;
|
||||
gboolean stop_after_first_frame;
|
||||
|
||||
gboolean frame_cmap_active;
|
||||
CMap frame_color_map;
|
||||
@ -1088,6 +1089,9 @@ gif_get_lzw (GifContext *context)
|
||||
*/
|
||||
context->frame = NULL;
|
||||
context->frame_cmap_active = FALSE;
|
||||
|
||||
if (context->stop_after_first_frame)
|
||||
context->state = GIF_DONE;
|
||||
}
|
||||
|
||||
return v;
|
||||
@ -1430,6 +1434,7 @@ new_context (void)
|
||||
context->gif89.disposal = -1;
|
||||
context->animation->loop = 1;
|
||||
context->in_loop_extension = FALSE;
|
||||
context->stop_after_first_frame = FALSE;
|
||||
|
||||
return context;
|
||||
}
|
||||
@ -1454,6 +1459,7 @@ gdk_pixbuf__gif_image_load (FILE *file, GError **error)
|
||||
|
||||
context->file = file;
|
||||
context->error = error;
|
||||
context->stop_after_first_frame = TRUE;
|
||||
|
||||
if (gif_main_loop (context) == -1 || context->animation->frames == NULL) {
|
||||
if (context->error && *(context->error) == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user