summaryrefslogtreecommitdiff
path: root/image/jpeg.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/jpeg.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/jpeg.c')
-rw-r--r--image/jpeg.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/image/jpeg.c b/image/jpeg.c
index e96faaa67..1d66b05d3 100644
--- a/image/jpeg.c
+++ b/image/jpeg.c
@@ -27,7 +27,7 @@
#ifdef WITH_JPEG
/* This must come first due to libpng issues */
-#include "content/content.h"
+#include "content/content_protected.h"
#include <assert.h>
#include <setjmp.h>
@@ -89,6 +89,10 @@ bool nsjpeg_convert(struct content *c, int w, int h)
uint8_t * volatile pixels = NULL;
size_t rowstride;
union content_msg_data msg_data;
+ const char *data;
+ unsigned long size;
+
+ data = content__get_source_data(c, &size);
cinfo.err = jpeg_std_error(&jerr.pub);
jerr.pub.error_exit = nsjpeg_error_exit;
@@ -102,8 +106,8 @@ bool nsjpeg_convert(struct content *c, int w, int h)
return false;
}
jpeg_create_decompress(&cinfo);
- source_mgr.next_input_byte = (unsigned char *) c->source_data;
- source_mgr.bytes_in_buffer = c->source_size;
+ source_mgr.next_input_byte = (unsigned char *) data;
+ source_mgr.bytes_in_buffer = size;
cinfo.src = &source_mgr;
jpeg_read_header(&cinfo, TRUE);
cinfo.out_color_space = JCS_RGB;
@@ -161,7 +165,7 @@ bool nsjpeg_convert(struct content *c, int w, int h)
c->title = malloc(100);
if (c->title)
snprintf(c->title, 100, messages_get("JPEGTitle"),
- width, height, c->source_size);
+ width, height, size);
c->size += height * rowstride + 100;
c->status = CONTENT_STATUS_DONE;
/* Done: update status bar */