summaryrefslogtreecommitdiffstats
path: root/apps/buffering.c
diff options
context:
space:
mode:
authorAndrew Mahone <andrew.mahone@gmail.com>2008-12-09 23:07:59 +0000
committerAndrew Mahone <andrew.mahone@gmail.com>2008-12-09 23:07:59 +0000
commit781421afa2085b841b52f876d80f484f565c0755 (patch)
treee952fe4857a1ee3edb91642bfbb96c93947748b4 /apps/buffering.c
parenta2c71fde1bdb1a62cf66ae0e3b9a864824930dd0 (diff)
downloadrockbox-781421afa2085b841b52f876d80f484f565c0755.tar.gz
rockbox-781421afa2085b841b52f876d80f484f565c0755.tar.bz2
rockbox-781421afa2085b841b52f876d80f484f565c0755.zip
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.c12
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