Closed
Bug 632119
Opened 13 years ago
Closed 13 years ago
For all data URI images, "View Image Info" says "Dimensions: 0px x 0px" & has broken "Media Preview"
Categories
(Firefox :: Page Info Window, defect)
Firefox
Page Info Window
Tracking
()
RESOLVED
FIXED
Firefox 11
People
(Reporter: dholbert, Assigned: felix)
References
Details
(Keywords: regression)
Attachments
(2 files)
232 bytes,
image/png
|
Details | |
1.54 KB,
patch
|
Gavin
:
review+
|
Details | Diff | Splinter Review |
STEPS TO REPRODUCE: 1. Load the following data: URI (for a green 100x100 block): data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00d%00%00%00d%08%06%00%00%00p%E2%95T%00%00%00%01sRGB%00%AE%CE%1C%E9%00%00%00%A2IDATx%DA%ED%D1%01%0D%00%00%08%C3%B0%83%7F%CF%60%83%90N%C2Z%99Lt%A6%B6%00%88%80%00%11%10%20%02%02D%40%80%08%88%80%00%11%10%20%02%02D%40%80%08%88%80%00%11%10%20%02%02D%40%80%08%88%80%00%11%10%20%02%02D%40%80%08%88%80%00%11%10%20%02%02D%40%80%08%88%80%00%11%10%20%02%02D%40%80%08%88%80%00%11%10%20%02%02D%40%80%08%88%80%00%11%10%20%02%02D%40%80%08%88%80%00%11%10%20%02%02D%40%80%08%88%80%00%11%10%20%02%02D%40%80%08%08%10%01%11%10%20%02%02D%40%BE%B7%EBM%02%C6h%7D%EAl%00%00%00%00IEND%AEB%60%82 2. Right-click on the loaded image, and choose "View Image Info" ACTUAL RESULTS: The Image Info contains: "Dimensions: 0px x 0px" EXPECTED: "Dimensions: 100px x 100px" If I view the actual PNG image (not as a data URI), I get EXPECTED RESULTS.
Reporter | ||
Comment 1•13 years ago
|
||
Here's the image that's encoded by the data URI in comment 0. When you view this attached image directly (not as a data URI), you get EXPECTED RESULTS.
Reporter | ||
Comment 2•13 years ago
|
||
Additionally - for data URIs, there's a broken-image icon instead of the actual image, in the "Media Preview" box (at the bottom of the View Image Info).
Summary: "View Image Info" says "Dimensions: 0px x 0px" for all data URI images → For all data URI images, "View Image Info" says "Dimensions: 0px x 0px" & has broken "Media Preview"
Reporter | ||
Comment 3•13 years ago
|
||
See also Bug 599756, which was filed a few months back on similar issues with "moz-filedata:" images.
Comment 4•13 years ago
|
||
Hmm. So the page info code sets img.url and immediately reads the size. So it assumes some sort of sync cache hit or something happening here.
Comment 5•13 years ago
|
||
Actually, it looks like it never sets .url. Investigating.
Comment 6•13 years ago
|
||
And in particular, this check returns false: if (/^data:/.test(url) && /^image\//.test(img[COL_IMAGE_NODE].type)) because img[COL_IMAGE_NODE].type is undefined. So checkProtocol returns false, and page info doesn't do anything with this image. This is a regression from bug 377349 which moved some code around incorrectly (and replaced "mimeType" with "type" in the process).
Blocks: 377349
Component: ImageLib → Page Info
Keywords: regression
Product: Core → Firefox
QA Contact: imagelib → page.info
Comment 7•13 years ago
|
||
Setting to All/All as I can reproduce this on Win7
OS: Linux → All
Hardware: x86_64 → All
Comment 10•13 years ago
|
||
Since tmyoung is not around, over to the bug 377349 reviewer.
Assignee: nobody → db48x
Comment 11•13 years ago
|
||
Indeed Firefox 10 users wonder "speaking of which, why in Firefox when I click "View Background Image" on an average Wikipedia page do I get data:image/png;base64,iVBORw0... "1x1" pixels and all just white? and in Page Info > Media there are several more, all "0x0" pixels. Are they just all white nothingness, or is this a Firefox bug?"
Reporter | ||
Comment 12•13 years ago
|
||
(In reply to jidanni from comment #11) > Are they just all white nothingness, or is this a Firefox bug?" They're not white nothingness -- what you're describing is a firefox bug. (It's this bug, in fact! :) ) Note that this affects moz-filedata: URIs as well (e.g. it affects http://mxr.mozilla.org/mozilla-central/source/layout/reftests/svg/as-image/img-blobBuilder-1.html )
Summary: For all data URI images, "View Image Info" says "Dimensions: 0px x 0px" & has broken "Media Preview" → For all data URI & moz-filedata images, "View Image Info" says "Dimensions: 0px x 0px" & has broken "Media Preview"
Reporter | ||
Comment 13•13 years ago
|
||
(ah, sorry -- the moz-filedata brokenness is covered by bug 599756)
Summary: For all data URI & moz-filedata images, "View Image Info" says "Dimensions: 0px x 0px" & has broken "Media Preview" → For all data URI images, "View Image Info" says "Dimensions: 0px x 0px" & has broken "Media Preview"
Comment 14•13 years ago
|
||
Gavin, can you find someone to fix this, please? Note that the "View background image" issue is separate from this bug. Please file a bug on it, with steps to reproduce.
Comment 15•13 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #14) > Note that the "View background image" issue is separate from this bug. > Please file a bug on it, with steps to reproduce. Just view the background image on Wikipedia. Same problem.
Reporter | ||
Comment 16•13 years ago
|
||
That works fine for me (it loads a 1x1 PNG image with a data URI directly). That's all correct so far. At that point, if I then do view-page-info, *then* we hit this bug (because at that point we're basically following my STR from comment 0). If that's what you're talking about, cool. If not, please file another bug, as bz requested.
Comment 17•13 years ago
|
||
OK filed Bug 703784.
Assignee | ||
Updated•13 years ago
|
Assignee: db48x → ffung
Assignee | ||
Comment 18•13 years ago
|
||
- Fixed and simplified checkProtocol
Attachment #578578 -
Flags: review?(gavin.sharp)
Updated•13 years ago
|
Attachment #578578 -
Flags: review?(gavin.sharp) → review+
Assignee | ||
Comment 19•13 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/71b2a65fe3f0
Assignee | ||
Comment 20•13 years ago
|
||
This fixes the bug introduced by bug 377349 and makes data image URIs work. Is there any reason we don't allow _all_ data URIs to work as long as pageInfo.js can handle the object type (e.g. audio/video elements)?
Comment 21•13 years ago
|
||
Felix: since we support audio and video tags already in page info, I would see no harm in this, but I can't remember if there is any other object type that can be handled through data:, if there is something like flash/javascript or another security-sensitive item (since page info currently runs in chrome), that would cause a problem--otherwise, being the person who wrote the original code, I see no problem.
Updated•13 years ago
|
Target Milestone: --- → Firefox 11
Comment 22•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/71b2a65fe3f0
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 24•13 years ago
|
||
For reference, here's a base64-encoded version of the image in comment 0: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAAXNSR0IArs4c6QAAAKJJREFUeNrt0QENAAAIw7CDf89gg5BOwlqZTHSmtgCIgAARECACAkRAgAiIgAARECACAkRAgAiIgAARECACAkRAgAiIgAARECACAkRAgAiIgAARECACAkRAgAiIgAARECACAkRAgAiIgAARECACAkRAgAiIgAARECACAkRAgAiIgAARECACAkRAgAiIgAARECACAkRAgAgIEAERECACAkRAvrfrTQLGaH3qbAAAAABJRU5ErkJggg%3D%3D (mostly posting for the purposes of discussion on bug 715075)
You need to log in
before you can comment on or make changes to this bug.
Description
•