diff options
author | Andrew Mahone <andrew.mahone@gmail.com> | 2008-12-09 23:07:59 +0000 |
---|---|---|
committer | Andrew Mahone <andrew.mahone@gmail.com> | 2008-12-09 23:07:59 +0000 |
commit | 781421afa2085b841b52f876d80f484f565c0755 (patch) | |
tree | e952fe4857a1ee3edb91642bfbb96c93947748b4 /apps/buffering.c | |
parent | a2c71fde1bdb1a62cf66ae0e3b9a864824930dd0 (diff) |
resize-on-load for bitmap files on 2bpp and color targets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19374 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/buffering.c')
-rw-r--r-- | apps/buffering.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/buffering.c b/apps/buffering.c index ba613eb9db..dfc90065d6 100644 --- a/apps/buffering.c +++ b/apps/buffering.c @@ -52,6 +52,9 @@ #include "bmp.h" #include "appevents.h" #include "metadata.h" +#ifdef HAVE_ALBUMART +#include "albumart.h" +#endif #if MEM > 1 #define GUARD_BUFSIZE (32*1024) @@ -852,8 +855,13 @@ static int load_bitmap(int fd) bmp->maskdata = NULL; #endif - int free = (int)MIN(buffer_len - BUF_USED, buffer_len - buf_widx); - rc = read_bmp_fd(fd, bmp, free, FORMAT_ANY|FORMAT_DITHER); + int free = (int)MIN(buffer_len - BUF_USED, buffer_len - buf_widx) + - sizeof(struct bitmap); + + get_albumart_size(bmp); + + rc = read_bmp_fd(fd, bmp, free, FORMAT_NATIVE|FORMAT_DITHER| + FORMAT_RESIZE|FORMAT_KEEP_ASPECT); return rc + (rc > 0 ? sizeof(struct bitmap) : 0); } #endif |