Bug 77140 - Copy & paste from Word: missing images
Summary: Copy & paste from Word: missing images
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3.0.0.alpha0+ Master
Hardware: All Windows (All)
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:4.3.0 target:4.2.4
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-07 15:09 UTC by Miklos Vajna
Modified: 2014-04-09 10:10 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Reproducer document (40.32 KB, application/vnd.oasis.opendocument.text)
2014-04-07 15:09 UTC, Miklos Vajna
Details
Missing image. (30.99 KB, image/png)
2014-04-07 15:54 UTC, Miklos Vajna
Details
How it looks like with EMF_PLUS_DISABLE=1 (39.82 KB, image/png)
2014-04-07 15:55 UTC, Miklos Vajna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miklos Vajna 2014-04-07 15:09:35 UTC
Created attachment 97041 [details]
Reproducer document

How to reproduce: open Word, insert an EMF+ image, and some text before/after. Then select all, open Writer, and paste special -> Microsoft Word document. Save as ODT, File -> reload: the image is missing.

There are two problems here:

1) We do a pointless EMF import/export roundtrip here, which is unnecessary, and

2) Even if the replacement image is OK (so EMF+ import for this case is fine), on export, EMF+ throws away the embedded metafile.

Fixing either of the two problems fixes the missing image.

I'm attaching the resulting ODT, at the moment simply opening it shows the missing image (just the "before" and "after" strings are visible inside the image, and there is a large white gap between the two).

Additional details:

1) The problems happens on Windows only.

2) Possibly it's also necessary to have Word installed, otherwise Writer won't attempt to update the replacement image -> all is fine.

There is also a workaround: with EMF_PLUS_DISABLE=1 the importer creates a metafile that the exporter can handle fine, so that also solves the missing image problem.
Comment 1 Miklos Vajna 2014-04-07 15:54:54 UTC
Created attachment 97044 [details]
Missing image.

How it looks like by default.
Comment 2 Miklos Vajna 2014-04-07 15:55:20 UTC
Created attachment 97045 [details]
How it looks like with EMF_PLUS_DISABLE=1
Comment 3 Commit Notification 2014-04-07 16:10:06 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2a7fdf2a7bb7345c49c988dfd1fcdb41cebb8a1e

fdo#77140 embeddedobj: avoid unneeded conversion in ConvertBufferToFormat()



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2014-04-09 10:10:11 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1353fbe84644d73ae0e5267b48a387063606d0de&h=libreoffice-4-2

fdo#77140 embeddedobj: avoid unneeded conversion in ConvertBufferToFormat()


It will be available in LibreOffice 4.2.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.