summaryrefslogtreecommitdiff
path: root/image/png.c
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@netsurf-browser.org>2010-03-28 12:56:39 +0000
committerDaniel Silverstone <dsilvers@netsurf-browser.org>2010-03-28 12:56:39 +0000
commit270ef59a98d34fef418fb6cd27e46f3edc912948 (patch)
tree9d363b42d441640e1d2dbff3ba548a2cdf8d67a9 /image/png.c
parent21da4f5bdf74c6654730c32dfcc1c6b3d24da4b4 (diff)
downloadnetsurf-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/png.c')
-rw-r--r--image/png.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/image/png.c b/image/png.c
index e8bd55c59..dfb427230 100644
--- a/image/png.c
+++ b/image/png.c
@@ -30,7 +30,7 @@
#include "desktop/plotters.h"
-#include "content/content.h"
+#include "content/content_protected.h"
#include "image/bitmap.h"
@@ -62,8 +62,7 @@ static void row_callback(png_structp png, png_bytep new_row,
static void end_callback(png_structp png, png_infop info);
-bool nspng_create(struct content *c, struct content *parent,
- const char *params[])
+bool nspng_create(struct content *c, const struct http_parameter *params)
{
union content_msg_data msg_data;
@@ -264,16 +263,21 @@ void end_callback(png_structp png, png_infop info)
bool nspng_convert(struct content *c, int width, int height)
{
+ const char *data;
+ unsigned long size;
+
assert(c->data.png.png != NULL);
assert(c->data.png.info != NULL);
+ data = content__get_source_data(c, &size);
+
png_destroy_read_struct(&c->data.png.png, &c->data.png.info, 0);
c->title = malloc(NSPNG_TITLE_LEN);
if (c->title != NULL) {
snprintf(c->title, NSPNG_TITLE_LEN, messages_get("PNGTitle"),
- c->width, c->height, c->source_size);
+ c->width, c->height, size);
}
c->size += (c->width * c->height * 4) + NSPNG_TITLE_LEN;