summaryrefslogtreecommitdiff
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
parent719a36972b60165fc45b956703a4860855145548 (diff)
downloadnetsurf-a526209e747642c9dbd8c0cbe9ec2b5247c35d5e.tar.gz
netsurf-a526209e747642c9dbd8c0cbe9ec2b5247c35d5e.tar.bz2
More useful title info for images.
-rw-r--r--!NetSurf/Resources/de/Messages22
-rw-r--r--!NetSurf/Resources/en/Messages22
-rw-r--r--!NetSurf/Resources/fr/Messages22
-rw-r--r--!NetSurf/Resources/it/Messages22
-rw-r--r--!NetSurf/Resources/nl/Messages22
-rw-r--r--Makefile.sources2
-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
-rw-r--r--resources/FatMessages110
-rw-r--r--riscos/content-handlers/artworks.c7
-rw-r--r--riscos/content-handlers/draw.c7
-rw-r--r--riscos/content-handlers/sprite.c7
-rw-r--r--utils/nsurl.c32
-rw-r--r--utils/nsurl.h14
19 files changed, 197 insertions, 142 deletions
diff --git a/!NetSurf/Resources/de/Messages b/!NetSurf/Resources/de/Messages
index 35d8cc24f..97e6e8897 100644
--- a/!NetSurf/Resources/de/Messages
+++ b/!NetSurf/Resources/de/Messages
@@ -687,17 +687,17 @@ SelectMenu:Auswahl
# Content titles
#
-DrawTitle:Draw Bild (%lux%lu, %lu bytes)
-GIFTitle:GIF Bild (%lux%lu, %lu bytes)
-BMPTitle:BMP Bild (%lux%lu, %lu bytes)
-ICOTitle:ICO Bild (%lux%lu, %lu bytes)
-JPEGTitle:JPEG Bild (%ux%u, %lu bytes)
-PNGTitle:PNG Bild (%lux%lu, %lu bytes)
-JNGTitle:JNG Bild (%lux%lu, %lu bytes)
-MNGTitle:MNG Bild (%lux%lu, %lu bytes)
-WebPTitle:WebP Bild (%lux%lu, %lu bytes)
-SpriteTitle:Sprite Bild (%lux%lu, %lu bytes)
-ArtWorksTitle:ArtWorks Bild (%lux%lu, %lu bytes)
+GIFTitle:%s (GIF Bild %lux%lu pixels)
+BMPTitle:%s (BMP Bild %lux%lu pixels)
+ICOTitle:%s (ICO Bild %lux%lu pixels)
+PNGTitle:%s (PNG Bild %lux%lu pixels)
+JNGTitle:%s (JNG Bild %lux%lu pixels)
+MNGTitle:%s (MNG Bild %lux%lu pixels)
+JPEGTitle:%s (JPEG Bild %lux%lu pixels)
+WebPTitle:%s (WebP Bild %lux%lu pixels)
+DrawTitle:%s (Drawfile Bild %lux%lu pixels)
+SpriteTitle:%s (Sprite Bild %lux%lu pixels)
+ArtWorksTitle:%s (ArtWorks Bild %lux%lu pixels)
# HTML page character set
#
diff --git a/!NetSurf/Resources/en/Messages b/!NetSurf/Resources/en/Messages
index 28e197ef0..7ee99ea80 100644
--- a/!NetSurf/Resources/en/Messages
+++ b/!NetSurf/Resources/en/Messages
@@ -687,17 +687,17 @@ SelectMenu:Select
# Content titles
#
-DrawTitle:Draw image (%lux%lu, %lu bytes)
-GIFTitle:GIF image (%lux%lu, %lu bytes)
-BMPTitle:BMP image (%lux%lu, %lu bytes)
-ICOTitle:ICO image (%lux%lu, %lu bytes)
-JPEGTitle:JPEG image (%ux%u, %lu bytes)
-PNGTitle:PNG image (%lux%lu, %lu bytes)
-JNGTitle:JNG image (%lux%lu, %lu bytes)
-MNGTitle:MNG image (%lux%lu, %lu bytes)
-WebPTitle:WebP image (%lux%lu, %lu bytes)
-SpriteTitle:Sprite image (%lux%lu, %lu bytes)
-ArtWorksTitle:ArtWorks image (%lux%lu, %lu bytes)
+GIFTitle:%s (GIF image %lux%lu pixels)
+BMPTitle:%s (BMP image %lux%lu pixels)
+ICOTitle:%s (ICO image %lux%lu pixels)
+PNGTitle:%s (PNG image %lux%lu pixels)
+JNGTitle:%s (JNG image %lux%lu pixels)
+MNGTitle:%s (MNG image %lux%lu pixels)
+JPEGTitle:%s (JPEG image %lux%lu pixels)
+WebPTitle:%s (WebP image %lux%lu pixels)
+DrawTitle:%s (Drawfile image %lux%lu pixels)
+SpriteTitle:%s (Sprite image %lux%lu pixels)
+ArtWorksTitle:%s (ArtWorks image %lux%lu pixels)
# HTML page character set
#
diff --git a/!NetSurf/Resources/fr/Messages b/!NetSurf/Resources/fr/Messages
index 4be370bfe..f6994131e 100644
--- a/!NetSurf/Resources/fr/Messages
+++ b/!NetSurf/Resources/fr/Messages
@@ -687,17 +687,17 @@ SelectMenu:Sélection
# Content titles
#
-DrawTitle:Image Draw (%lux%lu, %lu octets)
-GIFTitle:Image GIF (%lux%lu, %lu octets)
-BMPTitle:Image BMP (%lux%lu, %lu octets)
-ICOTitle:Image BMP (%lux%lu, %lu octets)
-JPEGTitle:Image JPEG (%ux%u, %lu octets)
-PNGTitle:Image PNG (%lux%lu, %lu octets)
-JNGTitle:Image JNG (%lux%lu, %lu octets)
-MNGTitle:Image MNG (%lux%lu, %lu octets)
-WebPTitle:Image WebP (%lux%lu, %lu octets)
-SpriteTitle:Image Sprite (%lux%lu, %lu octets)
-ArtWorksTitle:Image ArtWorks (%lux%lu, %lu octets)
+GIFTitle:%s (Image GIF %lux%lu pixels)
+BMPTitle:%s (Image BMP %lux%lu pixels)
+ICOTitle:%s (Image BMP %lux%lu pixels)
+PNGTitle:%s (Image PNG %lux%lu pixels)
+JNGTitle:%s (Image JNG %lux%lu pixels)
+MNGTitle:%s (Image MNG %lux%lu pixels)
+JPEGTitle:%s (Image JPEG %lux%lu pixels)
+WebPTitle:%s (Image WebP %lux%lu pixels)
+DrawTitle:%s (Image Drawfile %lux%lu pixels)
+SpriteTitle:%s (Image Sprite %lux%lu pixels)
+ArtWorksTitle:%s (Image ArtWorks %lux%lu pixels)
# HTML page character set
#
diff --git a/!NetSurf/Resources/it/Messages b/!NetSurf/Resources/it/Messages
index 9b670170f..cf0728c7c 100644
--- a/!NetSurf/Resources/it/Messages
+++ b/!NetSurf/Resources/it/Messages
@@ -687,17 +687,17 @@ SelectMenu:Seleziona
# Content titles
#
-DrawTitle:Immagine Draw (%lux%lu, %lu byte)
-GIFTitle:Immagine GIF (%lux%lu, %lu byte)
-BMPTitle:Immagine BMP (%lux%lu, %lu byte)
-ICOTitle:Immagine ICO (%lux%lu, %lu byte)
-JPEGTitle:Immagine JPEG (%ux%u, %lu byte)
-PNGTitle:Immagine PNG (%lux%lu, %lu byte)
-JNGTitle:Immagine JNG (%lux%lu, %lu byte)
-MNGTitle:Immagine MNG (%lux%lu, %lu byte)
-WebPTitle:Immagine WebP (%lux%lu, %lu byte)
-SpriteTitle:Immagine Sprite (%lux%lu, %lu byte)
-ArtWorksTitle:Immagine ArtWorks (%lux%lu, %lu byte)
+GIFTitle:%s (Immagine GIF %lux%lu pixels)
+BMPTitle:%s (Immagine BMP %lux%lu pixels)
+ICOTitle:%s (Immagine ICO %lux%lu pixels)
+PNGTitle:%s (Immagine PNG %lux%lu pixels)
+JNGTitle:%s (Immagine JNG %lux%lu pixels)
+MNGTitle:%s (Immagine MNG %lux%lu pixels)
+JPEGTitle:%s (Immagine JPEG %lux%lu pixels)
+WebPTitle:%s (Immagine WebP %lux%lu pixels)
+DrawTitle:%s (Immagine Drawfile %lux%lu pixels)
+SpriteTitle:%s (Immagine Sprite %lux%lu pixels)
+ArtWorksTitle:%s (Immagine ArtWorks %lux%lu pixels)
# HTML page character set
#
diff --git a/!NetSurf/Resources/nl/Messages b/!NetSurf/Resources/nl/Messages
index 06b8f0c0a..8eda66721 100644
--- a/!NetSurf/Resources/nl/Messages
+++ b/!NetSurf/Resources/nl/Messages
@@ -687,17 +687,17 @@ SelectMenu:Select
# Content titles
#
-DrawTitle:Draw image (%lux%lu, %lu bytes)
-GIFTitle:GIF image (%lux%lu, %lu bytes)
-BMPTitle:BMP image (%lux%lu, %lu bytes)
-ICOTitle:ICO image (%lux%lu, %lu bytes)
-JPEGTitle:JPEG image (%ux%u, %lu bytes)
-PNGTitle:PNG image (%lux%lu, %lu bytes)
-JNGTitle:JNG image (%lux%lu, %lu bytes)
-MNGTitle:MNG image (%lux%lu, %lu bytes)
-WebPTitle:WebP image (%lux%lu, %lu bytes)
-SpriteTitle:Sprite image (%lux%lu, %lu bytes)
-ArtWorksTitle:ArtWorks image (%lux%lu, %lu bytes)
+GIFTitle:%s (GIF image %lux%lu pixels)
+BMPTitle:%s (BMP image %lux%lu pixels)
+ICOTitle:%s (ICO image %lux%lu pixels)
+PNGTitle:%s (PNG image %lux%lu pixels)
+JNGTitle:%s (JNG image %lux%lu pixels)
+MNGTitle:%s (MNG image %lux%lu pixels)
+JPEGTitle:%s (JPEG image %lux%lu pixels)
+WebPTitle:%s (WebP image %lux%lu pixels)
+DrawTitle:%s (Drawfile image %lux%lu pixels)
+SpriteTitle:%s (Sprite image %lux%lu pixels)
+ArtWorksTitle:%s (ArtWorks image %lux%lu pixels)
# HTML page character set
#
diff --git a/Makefile.sources b/Makefile.sources
index d7229badc..1e990171b 100644
--- a/Makefile.sources
+++ b/Makefile.sources
@@ -26,7 +26,7 @@ S_HTTP := challenge.c generics.c primitives.c parameter.c \
S_DESKTOP := cookies.c history_global_core.c hotlist.c knockout.c \
mouse.c options.c plot_style.c print.c search.c searchweb.c \
- scrollbar.c sslcert.c textarea.c thumbnail.c tree.c \
+ scrollbar.c sslcert.c textarea.c thumbnail.c tree.c treeview.c \
tree_url_node.c version.c
# Javascript sources
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);
diff --git a/resources/FatMessages b/resources/FatMessages
index c2988a590..70d8f9698 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -2323,61 +2323,61 @@ nl.all.SelectMenu:Select
# Content titles
#
-en.all.DrawTitle:Draw image (%lux%lu, %lu bytes)
-de.all.DrawTitle:Draw Bild (%lux%lu, %lu bytes)
-fr.all.DrawTitle:Image Draw (%lux%lu, %lu octets)
-it.all.DrawTitle:Immagine Draw (%lux%lu, %lu byte)
-nl.all.DrawTitle:Draw image (%lux%lu, %lu bytes)
-en.all.GIFTitle:GIF image (%lux%lu, %lu bytes)
-de.all.GIFTitle:GIF Bild (%lux%lu, %lu bytes)
-fr.all.GIFTitle:Image GIF (%lux%lu, %lu octets)
-it.all.GIFTitle:Immagine GIF (%lux%lu, %lu byte)
-nl.all.GIFTitle:GIF image (%lux%lu, %lu bytes)
-en.all.BMPTitle:BMP image (%lux%lu, %lu bytes)
-de.all.BMPTitle:BMP Bild (%lux%lu, %lu bytes)
-fr.all.BMPTitle:Image BMP (%lux%lu, %lu octets)
-it.all.BMPTitle:Immagine BMP (%lux%lu, %lu byte)
-nl.all.BMPTitle:BMP image (%lux%lu, %lu bytes)
-en.all.ICOTitle:ICO image (%lux%lu, %lu bytes)
-de.all.ICOTitle:ICO Bild (%lux%lu, %lu bytes)
-fr.all.ICOTitle:Image BMP (%lux%lu, %lu octets)
-it.all.ICOTitle:Immagine ICO (%lux%lu, %lu byte)
-nl.all.ICOTitle:ICO image (%lux%lu, %lu bytes)
-en.all.JPEGTitle:JPEG image (%ux%u, %lu bytes)
-de.all.JPEGTitle:JPEG Bild (%ux%u, %lu bytes)
-fr.all.JPEGTitle:Image JPEG (%ux%u, %lu octets)
-it.all.JPEGTitle:Immagine JPEG (%ux%u, %lu byte)
-nl.all.JPEGTitle:JPEG image (%ux%u, %lu bytes)
-en.all.PNGTitle:PNG image (%lux%lu, %lu bytes)
-de.all.PNGTitle:PNG Bild (%lux%lu, %lu bytes)
-fr.all.PNGTitle:Image PNG (%lux%lu, %lu octets)
-it.all.PNGTitle:Immagine PNG (%lux%lu, %lu byte)
-nl.all.PNGTitle:PNG image (%lux%lu, %lu bytes)
-en.all.JNGTitle:JNG image (%lux%lu, %lu bytes)
-de.all.JNGTitle:JNG Bild (%lux%lu, %lu bytes)
-fr.all.JNGTitle:Image JNG (%lux%lu, %lu octets)
-it.all.JNGTitle:Immagine JNG (%lux%lu, %lu byte)
-nl.all.JNGTitle:JNG image (%lux%lu, %lu bytes)
-en.all.MNGTitle:MNG image (%lux%lu, %lu bytes)
-de.all.MNGTitle:MNG Bild (%lux%lu, %lu bytes)
-fr.all.MNGTitle:Image MNG (%lux%lu, %lu octets)
-it.all.MNGTitle:Immagine MNG (%lux%lu, %lu byte)
-nl.all.MNGTitle:MNG image (%lux%lu, %lu bytes)
-en.all.WebPTitle:WebP image (%lux%lu, %lu bytes)
-de.all.WebPTitle:WebP Bild (%lux%lu, %lu bytes)
-fr.all.WebPTitle:Image WebP (%lux%lu, %lu octets)
-it.all.WebPTitle:Immagine WebP (%lux%lu, %lu byte)
-nl.all.WebPTitle:WebP image (%lux%lu, %lu bytes)
-en.all.SpriteTitle:Sprite image (%lux%lu, %lu bytes)
-de.all.SpriteTitle:Sprite Bild (%lux%lu, %lu bytes)
-fr.all.SpriteTitle:Image Sprite (%lux%lu, %lu octets)
-it.all.SpriteTitle:Immagine Sprite (%lux%lu, %lu byte)
-nl.all.SpriteTitle:Sprite image (%lux%lu, %lu bytes)
-en.all.ArtWorksTitle:ArtWorks image (%lux%lu, %lu bytes)
-de.all.ArtWorksTitle:ArtWorks Bild (%lux%lu, %lu bytes)
-fr.all.ArtWorksTitle:Image ArtWorks (%lux%lu, %lu octets)
-it.all.ArtWorksTitle:Immagine ArtWorks (%lux%lu, %lu byte)
-nl.all.ArtWorksTitle:ArtWorks image (%lux%lu, %lu bytes)
+en.all.DrawTitle:%s (Draw image %lux%lu pixels)
+de.all.DrawTitle:%s (Draw Bild %lux%lu pixels)
+fr.all.DrawTitle:%s (Image Draw %lux%lu pixels)
+it.all.DrawTitle:%s (Immagine Draw %lux%lu pixels)
+nl.all.DrawTitle:%s (Draw image %lux%lu pixels)
+en.all.GIFTitle:%s (GIF image %lux%lu pixels)
+de.all.GIFTitle:%s (GIF Bild %lux%lu pixels)
+fr.all.GIFTitle:%s (Image GIF %lux%lu pixels)
+it.all.GIFTitle:%s (Immagine GIF %lux%lu pixels)
+nl.all.GIFTitle:%s (GIF image %lux%lu pixels)
+en.all.BMPTitle:%s (BMP image %lux%lu pixels)
+de.all.BMPTitle:%s (BMP Bild %lux%lu pixels)
+fr.all.BMPTitle:%s (Image BMP %lux%lu pixels)
+it.all.BMPTitle:%s (Immagine BMP %lux%lu pixels)
+nl.all.BMPTitle:%s (BMP image %lux%lu pixels)
+en.all.ICOTitle:%s (ICO image %lux%lu pixels)
+de.all.ICOTitle:%s (ICO Bild %lux%lu pixels)
+fr.all.ICOTitle:%s (Image BMP %lux%lu pixels)
+it.all.ICOTitle:%s (Immagine ICO %lux%lu pixels)
+nl.all.ICOTitle:%s (ICO image %lux%lu pixels)
+en.all.JPEGTitle:%s (JPEG image %lux%lu pixels)
+de.all.JPEGTitle:%s (JPEG Bild %lux%lu pixels)
+fr.all.JPEGTitle:%s (Image JPEG %lux%lu pixels)
+it.all.JPEGTitle:%s (Immagine JPEG %lux%lu pixels)
+nl.all.JPEGTitle:%s (JPEG image %lux%lu pixels)
+en.all.PNGTitle:%s (PNG image %lux%lu pixels)
+de.all.PNGTitle:%s (PNG Bild %lux%lu pixels)
+fr.all.PNGTitle:%s (Image PNG %lux%lu pixels)
+it.all.PNGTitle:%s (Immagine PNG %lux%lu pixels)
+nl.all.PNGTitle:%s (PNG image %lux%lu pixels)
+en.all.JNGTitle:%s (JNG image %lux%lu pixels)
+de.all.JNGTitle:%s (JNG Bild %lux%lu pixels)
+fr.all.JNGTitle:%s (Image JNG %lux%lu pixels)
+it.all.JNGTitle:%s (Immagine JNG %lux%lu pixels)
+nl.all.JNGTitle:%s (JNG image %lux%lu pixels)
+en.all.MNGTitle:%s (MNG image %lux%lu pixels)
+de.all.MNGTitle:%s (MNG Bild %lux%lu pixels)
+fr.all.MNGTitle:%s (Image MNG %lux%lu pixels)
+it.all.MNGTitle:%s (Immagine MNG %lux%lu pixels)
+nl.all.MNGTitle:%s (MNG image %lux%lu pixels)
+en.all.WebPTitle:%s (WebP image %lux%lu pixels)
+de.all.WebPTitle:%s (WebP Bild %lux%lu pixels)
+fr.all.WebPTitle:%s (Image WebP %lux%lu pixels)
+it.all.WebPTitle:%s (Immagine WebP %lux%lu pixels)
+nl.all.WebPTitle:%s (WebP image %lux%lu pixels)
+en.all.SpriteTitle:%s (Sprite image %lux%lu pixels)
+de.all.SpriteTitle:%s (Sprite Bild %lux%lu pixels)
+fr.all.SpriteTitle:%s (Image Sprite %lux%lu pixels)
+it.all.SpriteTitle:%s (Immagine Sprite %lux%lu pixels)
+nl.all.SpriteTitle:%s (Sprite image %lux%lu pixels)
+en.all.ArtWorksTitle:%s (ArtWorks image %lux%lu pixels)
+de.all.ArtWorksTitle:%s (ArtWorks Bild %lux%lu pixels)
+fr.all.ArtWorksTitle:%s (Image ArtWorks %lux%lu pixels)
+it.all.ArtWorksTitle:%s (Immagine ArtWorks %lux%lu pixels)
+nl.all.ArtWorksTitle:%s (ArtWorks image %lux%lu pixels)
# HTML page character set
#
diff --git a/riscos/content-handlers/artworks.c b/riscos/content-handlers/artworks.c
index 66808d42a..af1a3773c 100644
--- a/riscos/content-handlers/artworks.c
+++ b/riscos/content-handlers/artworks.c
@@ -172,7 +172,7 @@ bool artworks_convert(struct content *c)
void *init_routine;
os_error *error;
int used = -1; /* slightly better with older OSLib versions */
- char title[100];
+ char title[512];
/* check whether AWViewer has been seen and we can therefore
locate the ArtWorks rendering modules */
@@ -263,8 +263,9 @@ bool artworks_convert(struct content *c)
c->width = (aw->x1 - aw->x0) / 512;
c->height = (aw->y1 - aw->y0) / 512;
- snprintf(title, sizeof(title), messages_get("ArtWorksTitle"),
- c->width, c->height, source_size);
+ snprintf(title, sizeof(title), messages_get("ArtWorksTitle"),
+ nsurl_access_leaf(llcache_handle_get_url(c->llcache)),
+ c->width, c->height);
content__set_title(c, title);
content_set_ready(c);
content_set_done(c);
diff --git a/riscos/content-handlers/draw.c b/riscos/content-handlers/draw.c
index d18d580cd..1d5a6b5d3 100644
--- a/riscos/content-handlers/draw.c
+++ b/riscos/content-handlers/draw.c
@@ -113,7 +113,7 @@ bool draw_convert(struct content *c)
const void *data;
os_box bbox;
os_error *error;
- char title[100];
+ char title[512];
source_data = content__get_source_data(c, &source_size);
data = source_data;
@@ -141,8 +141,9 @@ bool draw_convert(struct content *c)
draw->x0 = bbox.x0;
draw->y0 = bbox.y0;
- snprintf(title, sizeof(title), messages_get("DrawTitle"), c->width,
- c->height, source_size);
+ snprintf(title, sizeof(title), messages_get("DrawTitle"),
+ 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/riscos/content-handlers/sprite.c b/riscos/content-handlers/sprite.c
index 9a70ebe75..96642d13d 100644
--- a/riscos/content-handlers/sprite.c
+++ b/riscos/content-handlers/sprite.c
@@ -111,7 +111,7 @@ bool sprite_convert(struct content *c)
const char *source_data;
unsigned long source_size;
const void *sprite_data;
- char title[100];
+ char title[512];
source_data = content__get_source_data(c, &source_size);
@@ -140,8 +140,9 @@ bool sprite_convert(struct content *c)
c->width = w;
c->height = h;
- snprintf(title, sizeof(title), messages_get("SpriteTitle"), c->width,
- c->height, source_size);
+ snprintf(title, sizeof(title), messages_get("SpriteTitle"),
+ nsurl_access_leaf(llcache_handle_get_url(c->llcache)),
+ c->width, c->height);
content__set_title(c, title);
content_set_ready(c);
content_set_done(c);
diff --git a/utils/nsurl.c b/utils/nsurl.c
index 47b7f5451..8c525452a 100644
--- a/utils/nsurl.c
+++ b/utils/nsurl.c
@@ -1564,6 +1564,38 @@ const char *nsurl_access(const nsurl *url)
/* exported interface, documented in nsurl.h */
+const char *nsurl_access_leaf(const nsurl *url)
+{
+ size_t path_len;
+ const char *path;
+ const char *leaf;
+
+ if (url->components.path == NULL)
+ return "";
+
+ path = lwc_string_data(url->components.path);
+ path_len = lwc_string_length(url->components.path);
+
+ if (path_len == 0)
+ return "";
+
+ if (path_len == 1 && *path == '/')
+ return "/";
+
+ leaf = path + path_len;
+
+ do {
+ leaf--;
+ } while ((leaf != path) && (*leaf != '/'));
+
+ if (*leaf == '/')
+ leaf++;
+
+ return leaf;
+}
+
+
+/* exported interface, documented in nsurl.h */
size_t nsurl_length(const nsurl *url)
{
assert(url != NULL);
diff --git a/utils/nsurl.h b/utils/nsurl.h
index 068d08b8d..b075c42a1 100644
--- a/utils/nsurl.h
+++ b/utils/nsurl.h
@@ -183,6 +183,20 @@ const char *nsurl_access(const nsurl *url);
/**
+ * Access a URL's path leaf as a string
+ *
+ * \param url NetSurf URL to retrieve a string pointer for.
+ * \return the required string
+ *
+ * The returned string is owned by the NetSurf URL object. It will die
+ * with the NetSurf URL object. Keep a reference to the URL if you need it.
+ *
+ * The returned string has a trailing '\0'.
+ */
+const char *nsurl_access_leaf(const nsurl *url);
+
+
+/**
* Find the length of a NetSurf URL object's URL, as returned by nsurl_access
*
* \param url NetSurf URL to find length of.