SVG: select and copy graphics to clipboard




13 years ago
6 years ago


(Reporter: jay, Unassigned)



Firefox Tracking Flags

(Not tracked)




13 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv: Gecko/20060313 Camino/1.0.0+
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv: Gecko/20060313 Camino/1.0.0+

It should be possible to copy selected graphic(s) to the clipboard.

Reproducible: Always

Steps to Reproduce:
1.drag over graphic to select and copy to clipboard

Actual Results:  
not possible

Expected Results:  
should be possible

Whilst mozilla UA are not authoring tools there is an expectation that one should be able to copy and paste text and graphics to the clipboard as within html.

this means that one should be able to select and copy to the clipboard:

text: see bug #306089

SVG graphics: possibly by dragging over <group>

graphics jpg gif other: may require another bug?

Comment 1

13 years ago
this bug is not about saving SVG to other formats

Comment 2

12 years ago
Please note Amaya 9.52 already had this facility, in a good alpha?

Comment 3

11 years ago
please implement this :-)

Comment 4

11 years ago

used to work but not anymore :-(

Comment 5

11 years ago
#3+4 this bug specifically relates to SVG images.
please make a separate report for your bug, possibly in plugins.



Summary: select and copy graphics to clipboard → SVG: select and copy graphics to clipboard

Comment 6

11 years ago
Allow <svg:use> to reference elements in other documents

related issue

Comment 7

11 years ago
download amaya

my test was on a short animation:

open the link above in amaya
open a new xhtml document in another window or tab
select some part of the svg in the amaya logo
paste into the new document
view source
graphic is copied with transforms but not animateTransform

this is rather buggy at present at least for me in os x, but does work with patience.
Duplicate of this bug: 455087
Assignee: general → nobody
QA Contact: ian → general
Duplicate of this bug: 571792


8 years ago
Ever confirmed: true

Comment 10

8 years ago
What does "copy" mean in the context of an SVG image?

Does it mean "create a bitmap representation of this image at current screen resolution and place it on the clipboard", or does it mean "copy the XML code used by the browser to render the SVG file and place that on the clipboard and hope that the clipboard and other apps understand SVG", or does it mean something else entirely?

NB: You can't do this with Flash, for which SVG is ostensibly a replacement, and you can't generally do this with other vector graphics or plugin content, either.

I'm un-confirming this because it was never confirmed properly in the first place.
URL: Any
Ever confirmed: false

Comment 11

8 years ago
Both ASV and Opera have a facility to copy SVG to the clipboard. They copy some kind of image rather than SVG source (ASV has a save SVG option to save SVG to file)
Yeah, it looks like Opera's "copy" creates a bitmap from the SVG.  If I paste it into Inkscape, it ends up as a raster image there.

The "select graphics for copying" part of Comment 0 sounds a bit odd / tricky -- do any other user agents (other than authoring tools) implement something like that?  If we're just outputting a rasterized content (as opposed to text or some sort of document-representation), I don't think precise selection really makes sense, at least for a first-pass implementation of this.

Dumping SVG to a bitmap and placing that on the clipboard (via right-click | "copy image", which is already available for raster images) shouldn't be too hard, though.

Comment 13

8 years ago

this bug clearly states that it is about saving as SVG
as per amaya

either close as wontfix or leave open until a decision is made.

Chris please be sure to identify on what authority you are closing as wontfix in the case that you chose this option
Ever confirmed: true
(In reply to comment #13)
> this bug clearly states that it is about saving as SVG
> as per amaya

No -- IIUC, this bug is about copying SVG to the clipboard -- not "saving as SVG". We can already save SVG content just fine. :) (and comment 0 never once mentions saving anything)

So, assuming you're looking for amaya-like copy/paste behavior, you still didn't answer Chris's question (for those who aren't familiar with amaya, including me). He asked:
> What does "copy" mean in the context of an SVG image?

Does Amaya copy a bitmap image, like Opera, or does it copy some fancier document representation?  (And if it's the latter, what happens e.g. if you try to paste that into a raster graphics editor vs. a vector graphics editor vs. a text-editor?)

Comment 15

8 years ago
Daniel  I was refering to saving a copy,

Amaya  copies some svg such as a group, this isnt simple, you may need to try  it out.
then one can paste into a new SVG document, or elsewhere etc.

the point being why  can one copy and paste text, images etc but not svg
(In reply to comment #15)
> then one can paste into a new SVG document, or elsewhere etc.

So it's the "elsewhere" use case that's most applicable here, for Gecko (since, unlike Amaya, we aren't an SVG authoring tool).

What happens if you copy some SVG content in amaya and paste it into another program?

Comment 17

8 years ago

How long have you got?

obviously this is dependent  on the application, that does not detract from the opportunity....

if no app copies, then there cant be apps to paste

you can paste into amaya...
I don't understand comment 17.

You seem to be asking (correct me if I'm wrong) for the ability to copy SVG in Firefox and paste it into another program, and you want it to work like it works in Amaya.  I'm asking, how *does* that work in Amaya? (when you paste into another program)

Comment 19

8 years ago
(In reply to comment #15)

> the point being why  can one copy and paste text, images etc but not svg

Is SVG text or an image? (And no, the answer cannot be "both".)

Fundamentally, doing what Opera does sounds like it's Good Enough™ for mainstream use. If SVG authors wish to copy SVG source code into an authoring tool (which Firefox and other Gecko browsers most definitely are NOT), they can either View Page Source on the SVG file itself, or they can save it locally, both of which are already functional in Gecko AFAIK.

If you think Gecko should copy SVG files as their vector source code, I suggest you file that specific request as a new bug, but don't be the least bit surprised if it gets WONTFIXed.

Comment 20

8 years ago
Begin forwarded message:

From: Chris Lawson <>
Date: 24 September 2010 20:11:21 BST
To: Jonathan Chetwynd <>
Subject: Re: why I am not amused

Kindly fuck off.


this is just so inappropriate that I would ask you not to  abuse my bugs in the future

Comment 21

8 years ago
iirc Amaya only allows  svg to be pasted into an XML document, and that seems a good solution.

most members of the public would not want to study  the  source, but might wish to copy or clone the resulting image. they cant unless a means of copying a group is provided.

using  the latest build of Amaya, open an svg document, or one that contains SVG
drag over a relevant graphic, it will show as selected, and may extend beyond dragged area. copy, then open a new document(drawing) and paste, then drag the  pasted image into place. copy another, paste into same document, save, close, open and image appears as before saved.

Regarding  #11 and Opera
"Firefox is still behind in this area."
but I did not immediately grasp how this works, the amaya approach is transparently simple, drag over something to be copied, and paste, results can be varied, but
You need to log in before you can comment on or make changes to this bug.