Issue 233916 in chromium: toDataURL('image/jpeg') produces PNG in chrome packaged app.

173 views
Skip to first unread message

chro...@googlecode.com

unread,
Apr 20, 2013, 8:05:31 PM4/20/13
to chromi...@chromium.org
Status: Unconfirmed
Owner: ----
Labels: Cr-Content-JavaScript Pri-2 Via-Wizard Type-Bug OS-Windows

New issue 233916 by Jparris...@gmail.com: toDataURL('image/jpeg') produces
PNG in chrome packaged app.
http://code.google.com/p/chromium/issues/detail?id=233916

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML,
like Gecko) Chrome/26.0.1410.64 Safari/537.31

Steps to reproduce the problem:
1. canvas.toDataURL('image/jpeg')
2.
3.

What is the expected behavior?
produce a DATA URI for a jpeg image.

What went wrong?
DATA URI produced is a png image.

Did this work before? N/A

Chrome version: 26.0.1410.64 Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)

Very similar to this issue:
https://code.google.com/p/chromium/issues/detail?id=53126

However it seems to only happen in Chrome packaged apps.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

chro...@googlecode.com

unread,
Apr 21, 2013, 5:57:14 PM4/21/13
to chromi...@chromium.org
Updates:
Cc: no...@chromium.org
Labels: -Cr-Content-JavaScript Cr-Blink-Canvas Cr-Platform-Apps

Comment #1 on issue 233916 by tk...@chromium.org: toDataURL('image/jpeg')
produces PNG in chrome packaged app.
http://code.google.com/p/chromium/issues/detail?id=233916

(No comment was entered for this change.)

chro...@googlecode.com

unread,
Apr 22, 2013, 12:55:01 AM4/22/13
to chromi...@chromium.org
Updates:
Status: Untriaged
Owner: mi...@chromium.org

Comment #2 on issue 233916 by no...@chromium.org: toDataURL('image/jpeg')
produces PNG in chrome packaged app.
http://code.google.com/p/chromium/issues/detail?id=233916

Issue 53126 is for web content (not packaged apps).

Tried canvas.toDataURL() for "image/png" and "image/jpeg" in a packaged
app, DOM security exception 18 appeared in the developer tools console in
both cases:

code: 18
message: "SecurityError: DOM Exception 18"
name: "SecurityError"
stack: "Error: An attempt was made to break through the security policy of
the user agent.↵ at <anonymous>:2:3↵ at
Object.InjectedScript._evaluateOn (<anonymous>:562:39)↵ at
Object.InjectedScript._evaluateAndWrap (<anonymous>:521:52)↵ at
Object.InjectedScript.evaluate (<anonymous>:440:21)"
__proto__: DOMException
...

Seems to be some issue with packaged app sec-policy: adding miket for triage

chro...@googlecode.com

unread,
Apr 22, 2013, 12:33:32 PM4/22/13
to chromi...@chromium.org
Updates:
Status: Assigned
Owner: asar...@chromium.org

Comment #3 on issue 233916 by mi...@chromium.org: toDataURL('image/jpeg')
produces PNG in chrome packaged app.
http://code.google.com/p/chromium/issues/detail?id=233916

Also see
http://stackoverflow.com/questions/16127441/todataurl-jpeg-not-working-properly-in-chrome-packaged-app.
Antony, will you please have a look?

chro...@googlecode.com

unread,
Apr 26, 2013, 2:25:10 PM4/26/13
to chromi...@chromium.org
Updates:
Cc: aba...@chromium.org
Labels: M-29

Comment #4 on issue 233916 by mi...@chromium.org: toDataURL('image/jpeg')
produces PNG in chrome packaged app.
http://code.google.com/p/chromium/issues/detail?id=233916

Noel,
Looks like you got a error while the reporter did not. Any idea what's
different in the 2 cases ? Can you also include the code to repro this ?

chro...@googlecode.com

unread,
Apr 29, 2013, 3:36:16 AM4/29/13
to chromi...@chromium.org

Comment #5 on issue 233916 by no...@chromium.org: toDataURL('image/jpeg')
produces PNG in chrome packaged app.
http://code.google.com/p/chromium/issues/detail?id=233916

The difference is probably due to me loading the packaged app locally.

chro...@googlecode.com

unread,
Apr 29, 2013, 3:43:18 AM4/29/13
to chromi...@chromium.org

Comment #6 on issue 233916 by no...@chromium.org: toDataURL('image/jpeg')
produces PNG in chrome packaged app.
http://code.google.com/p/chromium/issues/detail?id=233916

Chrome Version 26.0.1410.64 stable win7. I installed the CIRC irc client
(it's a packaged app)


https://chrome.google.com/webstore/detail/circ/bebigdkelppomhhjaaianniiifjbgocn

And ran it. I inspected it's bin/main.html page from the chrome menu
(hotdog->tools->extensions) in developer mode, and typed the following
commands

c = document.createElement('canvas')
document.body.insertBefore(c, document.body.firstChild)
c.getContext("2d").fillRect(0,0,c.width,c.height)
img = document.createElement('img')
img.src = "/static/icon/icon128.png"
document.body.insertBefore(img, document.body.firstChild)
c.getContext("2d").drawImage(img, 0, 0)
c.toDataURL()
c.toDataURL('image/jpeg')
c.toDataURL('image/jpeg', 0.1)

Picture of that (attached).

Attachments:
quic-to-data-url-packaged-app.png 82.2 KB

chro...@googlecode.com

unread,
Apr 29, 2013, 4:18:55 AM4/29/13
to chromi...@chromium.org

Comment #7 on issue 233916 by no...@chromium.org: toDataURL('image/jpeg')
produces PNG in chrome packaged app.
http://code.google.com/p/chromium/issues/detail?id=233916

The <canvas>.toDataURL('image/jpeg'...) calls produce 'data:image/jpeg...'
data URI as expected. They don't generate 'image/png' as stated in the bug
report.

chro...@googlecode.com

unread,
Aug 19, 2013, 4:19:46 PM8/19/13
to chromi...@chromium.org
Updates:
Labels: -M-30 MovedFrom-30

Comment #9 on issue 233916 by kar...@google.com: toDataURL('image/jpeg')
produces PNG in chrome packaged app.
http://code.google.com/p/chromium/issues/detail?id=233916#c9

This issue has already been moved once and is lower than Priority
1,therefore removing mstone.
Reply all
Reply to author
Forward
0 new messages