1
0
Fork 0
forked from len0rd/rockbox

imageviewer: gif viewer based on giflib-5.0.2

This adds ability to view gif images in rockbox.
Works both on color and gray/monochrome targets (greylib).
Aspect correction is supported as well.

Limitations:
- animated gifs are restricted to 32 frames
- animated gifs loop always (loopcount is ignored)
- plain text extension is not supported
- animated gifs with interframe delay = 0 are treated as still
  images (web browsers usually treat delay 0 as 100ms to prevent
  exhaustive CPU load by such images)

Change-Id: I61501f801ddcd403410e38d83e6bddc9883e7ede
This commit is contained in:
Marcin Bukat 2012-11-02 13:03:58 +01:00
parent b35f82c91f
commit 0ceaff2b65
23 changed files with 3006 additions and 15 deletions

View file

@ -28,8 +28,9 @@ static const char *decoder_names[MAX_IMAGE_TYPES] = {
"jpeg",
"png",
#ifdef HAVE_LCD_COLOR
"ppm"
"ppm",
#endif
"gif"
};
/* Check file type by magic number or file extension
@ -53,6 +54,7 @@ enum image_type get_image_type(const char *name, bool quiet)
#ifdef HAVE_LCD_COLOR
{ ".ppm", IMAGE_PPM },
#endif
{ ".gif", IMAGE_GIF },
};
static const struct {
char *magic; /* magic number */
@ -66,6 +68,8 @@ enum image_type get_image_type(const char *name, bool quiet)
{ "P3", 2, IMAGE_PPM },
{ "P6", 2, IMAGE_PPM },
#endif
{ "GIF87a", 6, IMAGE_GIF },
{ "GIF89a", 6, IMAGE_GIF },
};
enum image_type type = IMAGE_UNKNOWN;