summaryrefslogtreecommitdiff
path: root/image/mng.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2012-10-28 17:27:02 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2012-10-28 17:27:02 +0000
commitca25116c3aa8e8099a987c0f320c9385f6044b80 (patch)
tree9a69615c04fc8b24a69a5328268fd725a472233f /image/mng.c
parent98cfc5835ccd643578a269a934e8e96487ac1bf8 (diff)
parent33d40a08af97bae7e12164c5df5c3d2029dcf182 (diff)
downloadnetsurf-ca25116c3aa8e8099a987c0f320c9385f6044b80.tar.gz
netsurf-ca25116c3aa8e8099a987c0f320c9385f6044b80.tar.bz2
Merge branch 'master' of git://git.netsurf-browser.org/netsurf
Diffstat (limited to 'image/mng.c')
-rw-r--r--image/mng.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/image/mng.c b/image/mng.c
index 67625f026..518dc8552 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;
assert(c != NULL);
@@ -554,12 +554,15 @@ static bool nsmng_convert(struct content *c)
return nsmng_broadcast_error(mng, -1) == NSERROR_OK;
}
- /* Set the title
- */
- snprintf(title, sizeof(title),
- messages_get("MNGTitle"),
- c->width, c->height, size);
- content__set_title(c, title);
+
+ /* set title text */
+ title = messages_get_buff("MNGTitle",
+ nsurl_access_leaf(llcache_handle_get_url(c->llcache)),
+ c->width, c->height);
+ if (title != NULL) {
+ content__set_title(c, title);
+ free(title);
+ }
c->size += c->width * c->height * 4;
content_set_ready(c);
@@ -599,7 +602,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;
mng_handle handle;
assert(c != NULL);
@@ -613,11 +616,14 @@ static bool nsjpng_convert(struct content *c)
return nsmng_broadcast_error(mng, -1) == NSERROR_OK;
}
- /* Set the title */
- snprintf(title, sizeof(title),
- messages_get("PNGTitle"),
- c->width, c->height, size);
- content__set_title(c, title);
+ /* set title text */
+ title = messages_get_buff("PNGTitle",
+ nsurl_access_leaf(llcache_handle_get_url(c->llcache)),
+ c->width, c->height);
+ if (title != NULL) {
+ content__set_title(c, title);
+ free(title);
+ }
c->size += c->width * c->height * 4;
content_set_ready(c);