Bug 126313 - EMF image not exported to PDF (exported in new document)
Summary: EMF image not exported to PDF (exported in new document)
Status: RESOLVED DUPLICATE of bug 129085
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
6.2.5.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, implementationError
Depends on:
Blocks: PDF-Export
  Show dependency treegraph
 
Reported: 2019-07-09 15:49 UTC by Xisco Faulí
Modified: 2021-03-11 13:09 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
sample file (240.50 KB, application/msword)
2019-07-09 15:49 UTC, Xisco Faulí
Details
ODT reproducer (194.68 KB, application/vnd.oasis.opendocument.text)
2019-07-17 08:27 UTC, Miklos Vajna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2019-07-09 15:49:03 UTC
Created attachment 152689 [details]
sample file

Steps to reproduce:
1. Open attached document
2. Export it to PDF

-> Image is not displayed in PDF

Reproduced in

Version: 6.4.0.0.alpha0+
Build ID: 7a0164f0d82d91e2ac481d74cdacfe9a7ad6080f
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

[Bug found by office-interoperability-tools]
Comment 1 Xisco Faulí 2019-07-09 15:50:43 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=69b62cfcbd364d7f62142149c2f690104b217ca1

author	Miklos Vajna <vmiklos@collabora.com>	2019-05-27 21:24:42 +0200
committer	Miklos Vajna <vmiklos@collabora.com>	2019-05-28 09:10:15 +0200
commit	69b62cfcbd364d7f62142149c2f690104b217ca1 (patch)
tree	2584b8fc78810624981ad10e2c834793258bb23f
parent	d0d9acc7c6095e0bc640e073b9d8e2e19aaa8993 (diff)
tdf#125281 DOC import: fix size of lazy-loaded metafiles
Metafiles may have an external header, so once graphic data is read, we
need to set the size explicitly. Otherwise the width of the EMF image in
the bugdoc will be too small.

Bisected with: bibisect-linux64-6.3

Adding Cc: to Miklos Vajna
Comment 2 Miklos Vajna 2019-07-16 16:03:56 UTC
I'll try to see what's going on here. It's interesting: the bugdoc has 2 EMF images and only the header one is lost, the footer one is not. Also: if the bugdoc is converted to ODT, then the same problem is there, so the bug is rather in core / PDF export, the above commit only exposes the problem in the DOC import as well.

Anyhow: any idea how to decrease the size of the bugdoc? 241K is not an ideal size and if I replace the 867k EMF with the 43k one, the bug does away. :-/

I'm looking for something that is at least <= 50k and reproduces the problem. Thanks.
Comment 3 Miklos Vajna 2019-07-17 08:27:52 UTC
Created attachment 152822 [details]
ODT reproducer

I believe the above commit just started using EMF lazy-loading for DOC; but ODT was using EMF lazy-loading even earlier. That used to work, then broke with:

commit 362c1cf2bd580f6dc8bf27bdcd79174111bc1b5c
Author: Armin Le Grand <Armin.Le.Grand@me.com>
Date:   Tue Apr 2 17:59:40 2019 +0200

    tdf#124272 use ClipRegion's geometry if not a rectangle
Comment 4 Miklos Vajna 2019-07-17 08:42:32 UTC
If you follow the chain of regressions here, this leads to:

commit 059469926e359153b9b291790ef2df84fa63fda9
Author: Armin Le Grand <Armin.Le.Grand@cib.de>
Date:   Thu Nov 16 12:54:21 2017 +0100

    RotateFlyFrame3: Corrected Contour when rotated

So I believe this is an implementation error in that feature.

Armin: could you please take this over? I don't really understand how the clip region is not a rectangle in paintGraphicUsingPrimitivesHelper(), since it's a rectangular EMF image, as far as I see.

Thanks.
Comment 5 Timur 2020-10-22 06:33:17 UTC
Repro 7.1+. I add EMF to the title. Can't say what PNG does in ODT.
Regardless if in header or copied it that document body, not exported.
Exported if inserted in another ODT.
Comment 6 Xisco Faulí 2021-03-11 13:09:14 UTC
This is fixed with https://gerrit.libreoffice.org/c/core/+/112340.
Closing as duplicate of bug 129085

*** This bug has been marked as a duplicate of bug 129085 ***