Hi,

I have js code that fetches data from websocket. Each message is data-
uri encoded png. Then in jquery I do this:
    var i = $("<img />");
    i[0].src = "data:image/png;base64," + data;
immediately after that, sometimes i[0].width is 0, however I know that
width is 480.

If I just append this image to some div in my document it works fine
(it displays the whole image and it's not 0 in width), however if I
try immediately draw it on the canvas with:

c.getContext('2d').drawImage(i[0], wx, wy, i[0].width, i[0].height);

I get an error (because width and height is 0).

I think it's race condition somewhere in chrome, it looks like it
didn't decode data-uri at the time I was checking width.

Is image decoding happening in the separate thread? Do this symptoms
look like a chromium bug?

PN.

-- 
Chromium Discussion mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-discuss

Reply via email to