New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Nov 2013
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature



Sign in to add a comment

DevTools: Copy image as a data URL

Project Member Reported by aandrey@chromium.org, Nov 19 2013

Issue description

I'd like to copy image to a data URL string.

We could add this option to the context menu in the Resources panel for images, along with the existing
- "Copy Image URL"
- "Open Image in New Tab"

Meanwhile, I have to do the following:

var canvas = document.createElement("canvas");
var ctx = canvas.getContext("2d");
canvas.height = img.height;
canvas.width = img.width;
ctx.drawImage(img, 0, 0);
canvas.toDataURL();

But it does not always work, for example, with tainted images:

SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': tainted canvases may not be exported.


 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 26 2013

The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=162691

------------------------------------------------------------------------
r162691 | eustas@chromium.org | 2013-11-26T14:28:29.336808Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/ImageView.js?r1=162691&r2=162690&pathrev=162691

[DevTools] Resources: add "copy image as data url" menu item.

It is often convenient to grab image as data url.

BUG= 321132 

Review URL: https://codereview.chromium.org/88103002
------------------------------------------------------------------------

Comment 2 by eustas@chromium.org, Nov 26 2013

Status: Fixed

Sign in to add a comment