Bug 118659 - FILEOPEN: Read Error in .EPS images inserted in LibreOffice 6.0 beta1 or older
Summary: FILEOPEN: Read Error in .EPS images inserted in LibreOffice 6.0 beta1 or older
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.1 rc
Hardware: All All
: highest critical
Assignee: Caolán McNamara
URL:
Whiteboard: target:6.2.0 target:6.1.1
Keywords: bibisected, bisected, regression
Depends on:
Blocks: imageHandling-regressions
  Show dependency treegraph
 
Reported: 2018-07-10 08:27 UTC by Xisco Faulí
Modified: 2018-08-27 08:15 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
sample document (19.46 KB, application/vnd.oasis.opendocument.text)
2018-07-10 08:27 UTC, Xisco Faulí
Details
File created with LibreOffice 6.1 beta2 (37.64 KB, application/vnd.oasis.opendocument.text)
2018-07-19 17:25 UTC, Xisco Faulí
Details
File created with LibreOffice 6.1 beta1 (24.35 KB, application/vnd.oasis.opendocument.text)
2018-07-19 17:25 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2018-07-10 08:27:26 UTC
Created attachment 143422 [details]
sample document

Steps to reproduce:
1. Open the attached document

-> Observed behaviour: the image is not displayed. An error is displayed instead.

The document was created in

Version: 5.4.1.2
Build ID: ea7cb86e6eeb2bf3a5af73a8f7777ac570321527
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk2; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

using the attachment 143265 [details] from bug 118502

Reproduced in

Versión: 6.1.0.1
Id. de compilación: 378e26bd4f22a135cef5fa17afd5d4171d8da21a
Subprocs. CPU: 1; SO: Windows 6.1; Repres. IU: predet.; 
Configuración regional: ca-ES (es_ES); Calc: group threaded

and

Version: 6.2.0.0.alpha0+
Build ID: 67f3063b7c334d4d5c59132d90b938671aad09f0
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded
Comment 1 Xisco Faulí 2018-07-10 08:32:51 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=7b355669c6ddeab2e6cec692d6afdff41c61d0fb

author	Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>	2018-04-14 15:13:05 +0900
committer	Tomaž Vajngerl <quikee@gmail.com>	2018-04-20 09:15:22 +0200
commit	7b355669c6ddeab2e6cec692d6afdff41c61d0fb (patch)
tree	46c55326bccfa68a2bb5fad6d637e0f4576c8d68
parent	663fd3d6e1f93ec989dc289e688d5dbfe434cbca (diff)
Function to load graphic swapped out (loaded on demand)

Bisected with: bibisect-linux64-6.1

Adding Cc: to r	Tomaž Vajngerl
Comment 2 Xisco Faulí 2018-07-19 17:23:08 UTC
it seems it happens with .EPS images created with LibreOffice older than 6.0 beta2
Comment 3 Xisco Faulí 2018-07-19 17:25:01 UTC
Created attachment 143651 [details]
File created with LibreOffice 6.1 beta2
Comment 4 Xisco Faulí 2018-07-19 17:25:40 UTC
Created attachment 143652 [details]
File created with LibreOffice 6.1 beta1
Comment 6 Buovjaga 2018-07-19 17:42:07 UTC
Confirmed.

Arch Linux 64-bit
Version: 6.2.0.0.alpha0+
Build ID: 860a9daf2b45942a4b10ff22d36aa3fe29be19f4
CPU threads: 8; OS: Linux 4.17; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group threaded
Built on July 14th 2018
Comment 7 Buovjaga 2018-07-19 18:23:12 UTC
Reproduced on Windows by inserting the file in 5.4.2 Writer, saving and opening the ODT in 6.2.

Note that on Windows, you need to
1. Install ImageMagick https://www.imagemagick.org/script/download.php
2. Install pstoedit http://www.calvina.de/pstoedit/
3. Manually add the pstoedit directory to your Windows path
Comment 8 Julien Nabet 2018-07-26 19:31:58 UTC
I noticed that the file from 6.1 beta2 contained the eps + png whereas the initial sample file contains only the eps.
Comment 9 Julien Nabet 2018-07-26 19:49:32 UTC
The image of eps included in ko file is different than from eps and png of ok file.
eps from ko shows some sin/cos graphs
eps+png from ok file show some text.

On ok file from 6.1, i removed png file + ref of png file on content.xml, I got the error.

On ko file, I added png file + ref of png file on content.xml, LO asked about repairing the file but could open the file.

Perhaps we'd need a kind of hack which would call the insert eps file if no png is found?

Here's a part of bt which could help to find some code pointer:
#0  0x00007ffff0279c82 in GraphicFilter::ImportUnloadedGraphic(SvStream&) (this=0x7ffff0cda620 <rtl::Static<(anonymous namespace)::StandardGraphicFilter, (anonymous namespace)::theGraphicFilter>::get()::instance>, rIStream=...) at /home/julien/lo/libreoffice/vcl/source/filter/graphicfilter.cxx:1444
#1  0x00007ffff2cf830c in SvXMLGraphicHelper::ImplReadGraphic(rtl::OUString const&, rtl::OUString const&) (this=0x55555d2b8640, rPictureStorageName="Pictures", rPictureStreamName="2000000200000169000000D99F3EA97BFD720EBF.eps") at /home/julien/lo/libreoffice/svx/source/xml/xmlgrhlp.cxx:494
#2  0x00007ffff2cf89c0 in SvXMLGraphicHelper::loadGraphic(rtl::OUString const&) (this=0x55555d2b8640, rURL="Pictures/2000000200000169000000D99F3EA97BFD720EBF.eps")
    at /home/julien/lo/libreoffice/svx/source/xml/xmlgrhlp.cxx:579
#3  0x00007fffebe8ecc8 in SvXMLImport::loadGraphicByURL(rtl::OUString const&) (this=0x55555ba23530, rURL="Pictures/2000000200000169000000D99F3EA97BFD720EBF.eps")
    at /home/julien/lo/libreoffice/xmloff/source/core/xmlimp.cxx:1368
Comment 10 Caolán McNamara 2018-08-23 13:14:04 UTC
looks to me that the eps isn't handled by the "new function", but it did seek/read around in detecting the format so its not at its original position anymore

https://gerrit.libreoffice.org/#/c/59503/ works for me
Comment 11 Commit Notification 2018-08-23 15:58:53 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8051bdea4fa3fc75f9cb08facf79e64a24cd8bd9

Resolves: tdf#118659 eps not shown

It will be available in 6.2.0.

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 12 Caolán McNamara 2018-08-23 16:00:10 UTC
backport to 6-1 in gerrit
Comment 13 Commit Notification 2018-08-23 17:08:21 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=eaa1396573e25e8c52cb452e2b2471b9bdbd3c0f&h=libreoffice-6-1

Resolves: tdf#118659 eps not shown

It will be available in 6.1.1.

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 14 Samuel Thibault 2018-08-25 20:12:42 UTC
Hello,

I tried the nightly from https://dev-builds.libreoffice.org/daily/libreoffice-6-1/Linux-rpm_deb-x86_64@70-TDF/2018-08-24_07.20.45/ (git hash 29e5a7cc352e54570d512007421a550cab42d361). The image is getting displayed indeed,  but after saving the file and reopening it again, the image is all blurry, just like observed in bug https://bugs.documentfoundation.org/show_bug.cgi?id=118502
Comment 15 Xisco Faulí 2018-08-27 08:15:27 UTC
(In reply to Samuel Thibault from comment #14)
> Hello,
> 
> I tried the nightly from
> https://dev-builds.libreoffice.org/daily/libreoffice-6-1/Linux-rpm_deb-
> x86_64@70-TDF/2018-08-24_07.20.45/ (git hash
> 29e5a7cc352e54570d512007421a550cab42d361). The image is getting displayed
> indeed,  but after saving the file and reopening it again, the image is all
> blurry, just like observed in bug
> https://bugs.documentfoundation.org/show_bug.cgi?id=118502

Setting to VERIFIED then...