diff options
author | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2010-03-28 12:56:39 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2010-03-28 12:56:39 +0000 |
commit | 270ef59a98d34fef418fb6cd27e46f3edc912948 (patch) | |
tree | 9d363b42d441640e1d2dbff3ba548a2cdf8d67a9 /image/bmp.c | |
parent | 21da4f5bdf74c6654730c32dfcc1c6b3d24da4b4 (diff) | |
download | netsurf-270ef59a98d34fef418fb6cd27e46f3edc912948.tar.gz netsurf-270ef59a98d34fef418fb6cd27e46f3edc912948.tar.bz2 |
Merge jmb/new-cache; r=dsilvers,rs=vince
svn path=/trunk/netsurf/; revision=10180
Diffstat (limited to 'image/bmp.c')
-rw-r--r-- | image/bmp.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/image/bmp.c b/image/bmp.c index 2a27231ac..1774f945c 100644 --- a/image/bmp.c +++ b/image/bmp.c @@ -30,7 +30,7 @@ #include <stdlib.h> #include <libnsbmp.h> #include "utils/config.h" -#include "content/content.h" +#include "content/content_protected.h" #include "desktop/plotters.h" #include "image/bitmap.h" #include "image/bmp.h" @@ -49,8 +49,7 @@ bmp_bitmap_callback_vt bmp_bitmap_callbacks = { .bitmap_get_bpp = bitmap_get_bpp }; -bool nsbmp_create(struct content *c, struct content *parent, - const char *params[]) +bool nsbmp_create(struct content *c, const struct http_parameter *params) { union content_msg_data msg_data; @@ -71,12 +70,16 @@ bool nsbmp_convert(struct content *c, int iwidth, int iheight) bmp_image *bmp; union content_msg_data msg_data; uint32_t swidth; + const char *data; + unsigned long size; /* set the bmp data */ bmp = c->data.bmp.bmp; + data = content__get_source_data(c, &size); + /* analyse the BMP */ - res = bmp_analyse(bmp, c->source_size, (unsigned char *)c->source_data); + res = bmp_analyse(bmp, size, (unsigned char *) data); switch (res) { case BMP_OK: break; @@ -98,7 +101,7 @@ bool nsbmp_convert(struct content *c, int iwidth, int iheight) c->title = malloc(100); if (c->title) snprintf(c->title, 100, messages_get("BMPTitle"), c->width, - c->height, c->source_size); + c->height, size); swidth = bmp->bitmap_callbacks.bitmap_get_bpp(bmp->bitmap) * bmp->width; c->size += (swidth * bmp->height) + 16 + 44 + 100; |