Bug 344660 - Show frame count for animated GIFs in Image Properties. patch by Florian Queze <f.qu@queze.net>, r=me.

git-svn-id: svn://10.0.0.236/trunk@224426 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mozilla.mano%sent.com
2007-04-12 01:18:39 +00:00
parent 2e59562c94
commit 4aa7eec6a5
2 changed files with 17 additions and 4 deletions

View File

@@ -260,10 +260,21 @@ function checkForImage(elem, htmllocalname)
var imageRequest = img.QueryInterface(nsIImageLoadingContent)
.getRequest(nsIImageLoadingContent.CURRENT_REQUEST);
if (imageRequest)
setInfo("image-type", imageRequest.mimeType);
else
setInfo("image-type", "");
var imageType = "";
if (imageRequest) {
imageType = imageRequest.mimeType;
var imageMimeType = /^image\/(.*)/.exec(imageType);
if (imageMimeType) {
imageType = imageMimeType[1].toUpperCase();
var frameCount = imageRequest.image.numFrames;
if (frameCount > 1)
imageType = gMetadataBundle.getFormattedString("animatedImageType",
[imageType, frameCount]);
else
imageType = gMetadataBundle.getFormattedString("imageType", [imageType]);
}
}
setInfo("image-type", imageType);
var imageSize = "";
if (img.width) {

View File

@@ -9,6 +9,8 @@ altTextMissing=Missing
altTextBlank=Blank
imageSize=%S KB (%S bytes)
imageSizeUnknown=Unknown (not cached)
imageType=%S image
animatedImageType=%S image (animated, %S frames)
imageDimensions=%Spx \u00D7 %Spx
imageDimensionsScaled=%Spx \u00D7 %Spx (scaled to %Spx \u00D7 %Spx)
# LOCALIZATION NOTE: Next two strings are for language name representations