summaryrefslogtreecommitdiff
path: root/image
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2012-10-24 18:22:45 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2012-10-24 18:22:45 +0100
commita526209e747642c9dbd8c0cbe9ec2b5247c35d5e (patch)
treeccbcffa6952976c8c3f0a887c0f9e450de99bf7d /image
parent719a36972b60165fc45b956703a4860855145548 (diff)
downloadnetsurf-a526209e747642c9dbd8c0cbe9ec2b5247c35d5e.tar.gz
netsurf-a526209e747642c9dbd8c0cbe9ec2b5247c35d5e.tar.bz2
More useful title info for images.
Diffstat (limited to 'image')
-rw-r--r--image/bmp.c5
-rw-r--r--image/gif.c5
-rw-r--r--image/ico.c7
-rw-r--r--image/jpeg.c7
-rw-r--r--image/mng.c16
-rw-r--r--image/png.c5
-rw-r--r--image/webp.c5
7 files changed, 28 insertions, 22 deletions
diff --git a/image/bmp.c b/image/bmp.c
index c23f9dd54..5af042d3e 100644
--- a/image/bmp.c
+++ b/image/bmp.c
@@ -132,7 +132,7 @@ static bool nsbmp_convert(struct content *c)
uint32_t swidth;
const char *data;
unsigned long size;
- char title[100];
+ char title[512];
/* set the bmp data */
data = content__get_source_data(c, &size);
@@ -158,7 +158,8 @@ static bool nsbmp_convert(struct content *c)
c->height = bmp->bmp->height;
LOG(("BMP width %u height %u", c->width, c->height));
snprintf(title, sizeof(title), messages_get("BMPTitle"),
- c->width, c->height, size);
+ nsurl_access_leaf(llcache_handle_get_url(c->llcache)),
+ c->width, c->height);
content__set_title(c, title);
swidth = bmp->bmp->bitmap_callbacks.bitmap_get_bpp(bmp->bmp->bitmap) *
bmp->bmp->width;
diff --git a/image/gif.c b/image/gif.c
index 93316e03e..a33f56200 100644
--- a/image/gif.c
+++ b/image/gif.c
@@ -242,7 +242,7 @@ static bool nsgif_convert(struct content *c)
union content_msg_data msg_data;
const char *data;
unsigned long size;
- char title[100];
+ char title[512];
/* Get the animation */
data = content__get_source_data(c, &size);
@@ -279,7 +279,8 @@ static bool nsgif_convert(struct content *c)
c->width = gif->gif->width;
c->height = gif->gif->height;
snprintf(title, sizeof(title), messages_get("GIFTitle"),
- c->width, c->height, size);
+ nsurl_access_leaf(llcache_handle_get_url(c->llcache)),
+ c->width, c->height);
content__set_title(c, title);
c->size += (gif->gif->width * gif->gif->height * 4) + 16 + 44;
diff --git a/image/ico.c b/image/ico.c
index b9abd7d1c..ff8f9204c 100644
--- a/image/ico.c
+++ b/image/ico.c
@@ -100,7 +100,7 @@ static bool nsico_convert(struct content *c)
union content_msg_data msg_data;
const char *data;
unsigned long size;
- char title[100];
+ char title[512];
/* set the ico data */
data = content__get_source_data(c, &size);
@@ -125,8 +125,9 @@ static bool nsico_convert(struct content *c)
/* Store our content width and description */
c->width = ico->ico->width;
c->height = ico->ico->height;
- snprintf(title, sizeof(title), messages_get("ICOTitle"),
- c->width, c->height, size);
+ snprintf(title, sizeof(title), messages_get("ICOTitle"),
+ nsurl_access_leaf(llcache_handle_get_url(c->llcache)),
+ c->width, c->height);
content__set_title(c, title);
c->size += (ico->ico->width * ico->ico->height * 4) + 16 + 44;
diff --git a/image/jpeg.c b/image/jpeg.c
index 82fde0dd1..7c68fb668 100644
--- a/image/jpeg.c
+++ b/image/jpeg.c
@@ -289,7 +289,7 @@ static bool nsjpeg_convert(struct content *c)
union content_msg_data msg_data;
const char *data;
unsigned long size;
- char title[100];
+ char title[512];
/* check image header is valid and get width/height */
data = content__get_source_data(c, &size);
@@ -325,8 +325,9 @@ static bool nsjpeg_convert(struct content *c)
image_cache_add(c, NULL, jpeg_cache_convert);
- snprintf(title, sizeof(title), messages_get("JPEGTitle"),
- c->width, c->height, size);
+ snprintf(title, sizeof(title), messages_get("JPEGTitle"),
+ nsurl_access_leaf(llcache_handle_get_url(c->llcache)),
+ c->width, c->height);
content__set_title(c, title);
content_set_ready(c);
diff --git a/image/mng.c b/image/mng.c
index 67625f026..9ca9a2d48 100644
--- a/image/mng.c
+++ b/image/mng.c
@@ -541,7 +541,7 @@ static bool nsmng_convert(struct content *c)
nsmng_content *mng = (nsmng_content *) c;
mng_retcode status;
unsigned long size;
- char title[100];
+ char title[512];
assert(c != NULL);
@@ -556,9 +556,9 @@ static bool nsmng_convert(struct content *c)
/* Set the title
*/
- snprintf(title, sizeof(title),
- messages_get("MNGTitle"),
- c->width, c->height, size);
+ snprintf(title, sizeof(title), messages_get("MNGTitle"),
+ nsurl_access_leaf(llcache_handle_get_url(c->llcache)),
+ c->width, c->height);
content__set_title(c, title);
c->size += c->width * c->height * 4;
@@ -599,7 +599,7 @@ static bool nsjpng_convert(struct content *c)
nsmng_content *mng = (nsmng_content *) c;
mng_retcode status;
unsigned long size;
- char title[100];
+ char title[512];
mng_handle handle;
assert(c != NULL);
@@ -614,9 +614,9 @@ static bool nsjpng_convert(struct content *c)
}
/* Set the title */
- snprintf(title, sizeof(title),
- messages_get("PNGTitle"),
- c->width, c->height, size);
+ snprintf(title, sizeof(title), messages_get("PNGTitle"),
+ nsurl_access_leaf(llcache_handle_get_url(c->llcache)),
+ c->width, c->height);
content__set_title(c, title);
c->size += c->width * c->height * 4;
diff --git a/image/png.c b/image/png.c
index 6f1d926ee..99482d63d 100644
--- a/image/png.c
+++ b/image/png.c
@@ -510,7 +510,7 @@ png_cache_convert_error:
static bool nspng_convert(struct content *c)
{
nspng_content *png_c = (nspng_content *) c;
- char title[100];
+ char title[512];
assert(png_c->png != NULL);
assert(png_c->info != NULL);
@@ -520,7 +520,8 @@ static bool nspng_convert(struct content *c)
/* set title text */
snprintf(title, sizeof(title), messages_get("PNGTitle"),
- c->width, c->height, c->size);
+ nsurl_access_leaf(llcache_handle_get_url(c->llcache)),
+ c->width, c->height);
content__set_title(c, title);
diff --git a/image/webp.c b/image/webp.c
index 080cf8bb0..acf226b5f 100644
--- a/image/webp.c
+++ b/image/webp.c
@@ -78,7 +78,7 @@ static bool webp_convert(struct content *c)
unsigned char *imagebuf = NULL;
unsigned long size;
int width = 0, height = 0;
- char title[100];
+ char title[512];
int res = 0;
uint8_t *res_p = NULL;
@@ -117,7 +117,8 @@ static bool webp_convert(struct content *c)
c->width = width;
c->height = height;
snprintf(title, sizeof(title), messages_get("WebPTitle"),
- width, height, size);
+ nsurl_access_leaf(llcache_handle_get_url(c->llcache)),
+ c->width, c->height);
content__set_title(c, title);
bitmap_modified(webp->bitmap);