Bug 89797 - Copy & Paste from Inkscape: 1st time: Bitmap, 2nd time: vector with errors
Summary: Copy & Paste from Inkscape: 1st time: Bitmap, 2nd time: vector with errors
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.1.2 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 94136 (view as bug list)
Depends on:
Blocks: Paste
  Show dependency treegraph
 
Reported: 2015-03-03 10:29 UTC by FelixRuoff
Modified: 2020-01-31 19:55 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
dotted line SVG (2.93 KB, image/svg+xml)
2015-03-03 10:29 UTC, FelixRuoff
Details

Note You need to log in before you can comment on or make changes to this bug.
Description FelixRuoff 2015-03-03 10:29:10 UTC
Created attachment 113846 [details]
dotted line SVG

Hello!

Using LibreOffice Writer 4.4.1.2 and Inkscape 0.91 (Windows7).

I try to copy and paste image data from Inkscape to LibreOffice. The first paste-operation pastes an image, that looks like a bitmap (Inkscape data should be SVG style, so I would expect vectorized image data). If I paste the same clipboard-data again (to the same position in the LibreOffice-Writer document as an replacement for the image-data pasted before), the pasted image looks like a vectorized image, but some style-informations are lost (for example dotted lines are solid).

When I import the same Inkscape-data as a file by using the menue 'Einfügen->Medien->Bild' (english: Insert->Media->Image?), the style information is without errors.

Steps to reproduce:
1. Load the attached File in Inkscape
2. Select the dotted line by clicking on in
3. Use Ctrl+C to copy the line to clipboard
4. Open/Create a LibreOffice Writer document
5. Use Ctrl+V to paste the line to the writer document --> the line will appear dotted, but looks like a bitmap
6. Use Ctrl+V to paste the line again (as an replacement for the image just pasted before) --> the line will appear solid, but looks like a vectorized image.

Expected behaviour:
From my point of view, the pasted image data should result in a vector-image (SVG?) even for the first paste operation. The image should look like in inkscape (no information losing as implemented by image-inserting using the menu bar).

Kind regards, 
Felix
Comment 1 FelixRuoff 2015-03-03 12:42:06 UTC
Just want to add, that there is the same problem for gradient fills of rectangles. There will be the correct gradient at the first paste and a solid fill for the second paste operation.
Comment 2 Buovjaga 2015-03-06 10:55:59 UTC
Reproduced.

Lowering severity as importing works.

Win 7 Pro 64-bit, LibO Version: 4.4.1.2
Build ID: 45e2de17089c24a1fa810c8f975a7171ba4cd432
Locale: fi_FI

Inkscape 0.91.
Comment 3 tommy27 2016-04-16 07:26:57 UTC Comment hidden (obsolete)
Comment 4 Aron Budea 2016-12-26 08:53:07 UTC
Still occurs in 5.3.0.1 / Windows 7.
Comment 5 Aron Budea 2016-12-26 08:54:34 UTC
*** Bug 94136 has been marked as a duplicate of this bug. ***
Comment 6 Ole Tange 2017-10-10 15:36:46 UTC
Still occurs in 5.4.2.2 (Windows 10 x64) Build ID: 22b09f6418e8c2d508a9eaf86b2399209b0990f4.
Comment 7 himajin100000 2017-11-13 22:44:57 UTC
Just a guess:

Inkscape 0.92 puts the line graphics in some formats, including PNG and GDI meta file. Also note that the format it gives for svg is image/x-inkscape-svg, so Libreoffice would not understand that.
 
Solid line appears in any libreoffice application when we paste-special GDI metafile.

When we create a new writer document and just paste(not paste special) from clipboard, the format to be pasted is chosen based on the following priority.

https://opengrok.libreoffice.org/xref/core/sot/source/base/formats.cxx?r=0018fd1b#881

you see raster formats(PNG,JPG,BITMAP) coming earlier than GDI meta file in the above source code.

when Writer pastes one of these raster data, it SELECTS(marks?) the pasted area, and recognize that to be image. and this time, it will choose the format in the following priority.(FYI: If we deselect, Libreoffice chooses raster formats, and thus does not reproduce the bug when we do paste operation.)

https://opengrok.libreoffice.org/xref/core/sot/source/base/formats.cxx?r=0018fd1b#380

Here, Writer does the same thing as paste-specialing GDI metafile, thus produces buggy result.

There are a few questions that still remain as mysteries to me.

1. Why does LibreOffice produce this buggy result when I paste-special GDI metafile? 
2. When I looked the clipboard after copying Inkscape data, there were many 0 byte entries. those entries include CF_METAFILEPICT and CF_BITMAP. Why doesn't these data cause trouble?
3. Why is LibreOffice givig higher priority for the writer's first pasting?

Version: 6.0.0.0.alpha1+ (x64)
Build ID: a5af0fd9f27af42cf2e8571f659cdad6e606215b
CPU threads: 4; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2017-11-07_00:30:02
Locale: en-US (ja_JP); Calc: CL
Comment 8 Franklin Weng 2018-04-21 02:49:31 UTC
Still reproduced in LibreOffice 6.0.2.3 and Inkscape 0.92.3.

If I inserted an svg file (Insert > Image) in Impress it worked.  It would insert the vector graph successfully.

However if I copied the graph in an svg file and then directly copied it in Impress it would become a raster image.

I tried it with Linux version, the LibreOffice and Inkscape versions are as follows:

版本:6.0.3.2
組建 ID:1:6.0.3~rc2-0ubuntu0.16.04.1~lo2
CPU 執行緒:4; OS:Linux 4.11; UI 算繪:預設; VCL: kde4; 
語言地區:zh-TW (zh_TW.UTF-8); Calc: group

Inkscape 0.92.3 (unknown)

BTW, my friend tested it on Windows (10?) and he said that copy-paste on Windows works well.  I don't have a Windows box so I can't assure it for now.
Comment 9 QA Administrators 2019-04-22 02:56:31 UTC Comment hidden (obsolete)
Comment 10 Peter C. S. Scholtens 2020-01-31 19:55:31 UTC
I did some checks and the bug is present in the following settings:

[1] Ubuntu 18.04LTS with some updates via PPA's.
    LibreOffice 6.3.4.2 30(Build:2)
    Inkscape 0.92.4 (unknown)

[2] Ubuntu 19.10 (Eoan Ermine)
    LibreOffice 6.3.4.2 30(Build:2)
    Inkscape 0.92.4 (5da689c313, 2019-01-14)

[3] Ubuntu 19.10 (Eoan Ermine)
    LibreOffice commit 04405edc3fac32938b8940bc767656ea6c7820f9
    of Fri Jan 31 16:19:21 2020
    Inkscape 0.92.4 (5da689c313, 2019-01-14)

The bug is NOT present in an up-to-date Windows environment
    LibreOffice 6.x
    Inkscape 0.92.x

While using this copy- (from Inkscape) and-paste (to Writer) method frequently in Windows 7 environment without any problem, I noticed the Linux version of the paste action behaves a little bit different. If I do:

Paste Special -> More Options 

Then it does NOT show the the GDI metafile option which I had in Windows environment. Instead I only see these three options:

BitmapImage (BMP)
HyperText (HTML)
Unformatted text

Possible the SVG content in the paste buffer is wrongly detected as a HTML?