Bug 41119 - Copy SVG Code Directly into LibreOffice to Render Pictures
Summary: Copy SVG Code Directly into LibreOffice to Render Pictures
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: All All
: low enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsUXEval
Depends on:
Blocks: Paste
  Show dependency treegraph
 
Reported: 2011-09-22 07:10 UTC by vernonl63
Modified: 2023-12-01 15:26 UTC (History)
12 users (show)

See Also:
Crash report or crash signature:


Attachments
Example of Current SVG Copy and Paste in LibO-dev 3.5.0 (294.53 KB, application/zip)
2011-09-23 07:01 UTC, rk601
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vernonl63 2011-09-22 07:10:39 UTC
Dear LibreOffice Gurus:

Congratulations to everyone involved for winning the “InfoWorld BOSSIE – Best of Open Source – Awards 2011” for LibreOffice.

LibreOffice is getting better all the time, and its ability to use Scalable Vector Graphics (SVG) is improving. It appears that a goal of LibreOffice is to fully integrate DRAW into the LibreOffice suite, which will simplify exchanging graphics with all components of the suite. For example, if you create an image in Draw, reusing it in a Writer document is as simple as copying and pasting the image. You can also work with drawings directly from within Writer or Impress, using a subset of the functions and tools from Draw.

Even-though Draw’s functionality is extensive I was hoping that an enhancement will be made.

There are numerous SVG files available. It is very easy to obtain SVG code with a Web browser, select the SVG code, and copy that SVG code into another application or file. Please modify the LibreOffice suite so that SVG code can be pasted directly into the suite without having to create a new SVG file and then Inserting that new SVG file into LibreOffice.

Here are the proposed steps:

1. Launch a Web browser.
2. Navigate to the desired SVG picture (for example:  http://www.openclipart.org/people/gustavorezende/silhouettesurfer.svg).
3. With the Web Browser, Right Click the mouse, then choose View Page Source.
4. Select the SVG code and copy it.
5. Launch LibreOffice.
6. Choose File, New, Drawing.
7. Select Insert, Picture, (SVG Code). Note (SVG Code) currently does not appear.
8. Paste the previously copied SVG code into LibreOffice.
9. Click an OK button or Cancel to quit.
10. The SVG Picture will appear within document.

Please note that it is possible to insert a Picture with the Insert, Picture, From File.... command. However the ability to skip the file creation and loading steps would be a great time saver and nice enhancement.

Thank you!
Comment 1 rk601 2011-09-23 07:01:43 UTC
Created attachment 51544 [details]
Example of Current SVG Copy and Paste in LibO-dev 3.5.0

We agree! The ability to copy and paste SVG directly into LibreOffice would be a time saver and great enhancement!

As an example, we tested the desired enhancement in the Master:

LibO-dev 3.5.0 
Build ID: 47a101d-ea64cb6-1e62dcb-725236
On OSX 10.6.8

Located at:

http://dev-builds.libreoffice.org/daily/MacOSX_10.6.7_Intel_no-moz/master/2011-09-22_04.45.55/

with

master~2011-09-22_04.45.55_LibO-Dev_OOO350m1_MacOS_x86_install_en-US.dmg 

Steps to reproduce:

1. Use a Web browser or Graphic Editor to find an SVG picture (we used both).
2. Copy the SVG picture.
3. Paste the SVG picture directly into LibreOffice.
Expected results: SVG will appear within WRITER, DRAW, etc.
Actual results (vary): Either the SVG code (NOT PICTURE) appears or an Error appears.

For "SVG Copy and Paste from Web Browser.png" the copied SVG picture resulted in the insertion of the SVG code.

For "SVG Copy and Paste from Graphic Editor.png" the copied SVG picture resulted in the error "Requested clipboard format is not available."

Expected result is shown in "SVG Insert From File.png".

It would be nice to see this enhancement in LibO 3.5.0.
Comment 2 Björn Michaelsen 2011-12-23 12:33:56 UTC Comment hidden (obsolete)
Comment 3 sasha.libreoffice 2012-01-17 08:41:13 UTC
looks like duplicate of 
Bug 35146 - copy-paste from InkScape pastes text instead of image on Linux
Comment 4 sasha.libreoffice 2012-02-03 04:33:40 UTC
but it is not duplicate, here functionality should do this:
1) Clipboard contains text
2) this text inserts as svg picture
(I think it is be better use for this Edit->paste special or Insert->Picture->From clipboard)
Comment 5 Samuel Mehrbrodt (allotropia) 2013-04-23 16:18:01 UTC
Copy & pasting an SVG Image works for me in 4.0.2.
I tried copying it from the Gnome Image Viewer, then pasted it in LibreOffice and the Image appeared.

Bug 35146 deals with wrongly recognized MIME types in the clipboard. Thus I'm closing this bug.
Comment 6 sasha.libreoffice 2013-04-24 10:40:01 UTC
Sorry, but here copied should be text, not an image.
And inserted as image.
in 4.0.2 not implemented yet.
IMHO this is more naturally to implement as extension written on Basic or Python
Comment 7 Samuel Mehrbrodt (allotropia) 2013-04-24 11:48:01 UTC
But why would you want to copy a SVG file as text when you can just copy&paste the Image?
I don't think this feature belongs to the Core.
Buf if someone wants to write an extension, he can do so of course.
Comment 8 Joel Madero 2013-05-15 02:33:50 UTC
This is a valid request but I agree, not so sure why it's better than current solution. Marking as NEW as there's nothing wrong with the request per say, just not sure if/when it'll be implemented.

If user or someone can explain the benefit of this method, maybe we'd have a clearer understanding of the need for this feature.
Comment 9 Alice Tipping 2020-05-17 07:39:21 UTC Comment hidden (spam)
Comment 10 edward roberts 2021-01-08 19:58:21 UTC Comment hidden (spam)
Comment 11 Suzi 2021-07-26 10:23:36 UTC Comment hidden (spam)
Comment 12 Abhinav shaha 2021-07-28 10:46:58 UTC Comment hidden (spam)
Comment 13 Tommy Pruitt 2021-11-19 14:26:35 UTC Comment hidden (spam)
Comment 14 Edward wilson 2021-12-08 12:50:45 UTC Comment hidden (spam)
Comment 15 BogdanB 2023-10-30 16:42:00 UTC Comment hidden (obsolete)
Comment 16 Stéphane Guillou (stragu) 2023-11-16 20:34:31 UTC
UX/design team, what do you think?
To me, it doesn't make much sense to implement that.

Comment 0 could have copied the image directly as an image, instead of looking at the source. And one can copy-past a file directly into the document, without needing to open it.
If the clipboard contains plain text, it is normal that plain text is pasted and it is not interpreted.
What if someone writes a document about the SVG format and actually wants to paste the SVG code as text?

In my opinion, this should be closed as "won't fix".
Comment 17 Heiko Tietze 2023-11-17 10:06:18 UTC
+1 to WF, but let's pass it through the meeting
Comment 18 Regina Henschel 2023-11-17 11:08:48 UTC
Some times ago I have add a "Import MathML from Clipboard" to the Tools menu for MathML, for cases were the user has valid MathML content in the clipboard. I can imagine a similar tool for SVG markup. You need a dedicated tool for such cases, because the clipboard contains only a plain text.
Comment 19 V Stuart Foote 2023-11-17 12:19:59 UTC
(In reply to Regina Henschel from comment #18)
> Some times ago I have add a "Import MathML from Clipboard" to the Tools menu
> for MathML, for cases were the user has valid MathML content in the
> clipboard. I can imagine a similar tool for SVG markup. You need a dedicated
> tool for such cases, because the clipboard contains only a plain text.

+1, was thinking similar. An import from clipboard helper work flow has the advantage that by svgio filter reading the SVG's source XML from clipboard it would show user any filter issues with rendering the image to canvas.

Think visual attributes like stroke weight, font, scaling, transparency, etc.; giving user visual feedback as to fidelity during import, and when/if reported allowing for QA and dev adjustments to the filters in response.
Comment 20 Heiko Tietze 2023-11-17 12:53:48 UTC
Any blocker, Tomaz?
Comment 21 Tomaz Vajngerl 2023-11-19 05:04:29 UTC
I don't see any blockers - we just need to detect if the text is a valid SVG.
Comment 22 Heiko Tietze 2023-12-01 15:26:32 UTC
We discussed the topic in the design meeting.

The use case remain unclear, just to add a function similar to "Import MathML from Clipboard" does not solve any. The idea to tweak and inspect the SVG code is dangerous and results in the question what happens when one pastes just a part of the SVG definition on top of an existing image. If editing the clipboard becomes possible, the natural step would be to allow to modification to ODF or HTML data.

Besides, a lot of effort for a feature where not much interest has been over the years.