For all data URI images, "View Image Info" says "Dimensions: 0px x 0px" & has broken "Media Preview"

RESOLVED FIXED in Firefox 11

Status

()

Firefox
Page Info Window
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: dholbert, Assigned: felix)

Tracking

(Depends on: 1 bug, {regression})

Trunk
Firefox 11
regression
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

7 years ago
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

7 years ago
Created attachment 510334 [details]
reference case (same image, as a file)

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

7 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

7 years ago
See also Bug 599756, which was filed a few months back on similar issues with "moz-filedata:" images.
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.
Actually, it looks like it never sets .url.  Investigating.
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

7 years ago
Setting to All/All as I can reproduce this on Win7
OS: Linux → All
Hardware: x86_64 → All

Updated

6 years ago
Duplicate of this bug: 666861

Comment 9

6 years ago
so any plan to deal with this in recent? Maybe firefox 8?
Since tmyoung is not around, over to the bug 377349 reviewer.
Assignee: nobody → db48x

Comment 11

6 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

6 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

6 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"
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

6 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

6 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

6 years ago
OK filed Bug 703784.
(Assignee)

Updated

6 years ago
Assignee: db48x → ffung
(Assignee)

Comment 18

6 years ago
Created attachment 578578 [details] [diff] [review]
Fix View Image Info for Data URIs

- Fixed and simplified checkProtocol
Attachment #578578 - Flags: review?(gavin.sharp)
Attachment #578578 - Flags: review?(gavin.sharp) → review+
(Assignee)

Comment 19

6 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/71b2a65fe3f0
(Assignee)

Comment 20

6 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)?
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.
Target Milestone: --- → Firefox 11
https://hg.mozilla.org/mozilla-central/rev/71b2a65fe3f0
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Duplicate of this bug: 715075

Updated

6 years ago
Depends on: 715075
(Reporter)

Comment 24

6 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.