Bug 114057 - Reports: Imagecontrol doesn't show *.pdf-file
Summary: Reports: Imagecontrol doesn't show *.pdf-file
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.4.3.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-26 09:23 UTC by Robert Großkopf
Modified: 2018-11-28 15:10 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Extract the *.zip, open the database and start the report. (82.53 KB, application/zip)
2017-11-26 09:23 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2017-11-26 09:23:55 UTC
Created attachment 137990 [details]
Extract the *.zip, open the database and start the report.

Since LO 5.0 you could add not only images but all other files with the imagecontrol of a form to a database. First page of *.pdf-files will be shown in the imagecontrol of the form. Other files, which aren't known images, will leave a blank control.

Extract the attached folder. There is a database and some files, which are linked to the database: One image, one *.pdf-file and the same content as in the *.pdf-file as *.odt-file.
Open the database and start the report.
The image will be shown in the report.
The *.pdf-file won't be shown. Flickers here with failure-warning.
The *.odt-file won't be shown. Flickers here with a smaller failure-warning.

The *.pdf-file will be shown if you try to insert it as image in a writer-document. There are *.pdf-files, which will be shown in the imagecontrol of the report - but this special file seems to have problems.

All this I have tested on OpenSUSE 42.2 with 
Version: 5.4.3.2
Build-ID: 92a7159f7e4af62137622921e809f8546db437e5
CPU-Threads: 4; Betriebssystem:Linux 4.4; UI-Render: Standard; VCL: kde4; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group
Comment 1 Alex Thurgood 2017-11-27 09:19:55 UTC
Confirming with 

Version: 5.4.3.2
Build ID: 92a7159f7e4af62137622921e809f8546db437e5
CPU threads: 4; OS: Mac OS X 10.13.1; UI render: default; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group

I have found a workaround, however, but am unsure of its significance.

If, in Report Design mode, you select the image control and set the "Preserve Link" attribute to "No", then reload the report the PDF preview will be displayed.

An attempt is also made to display the content of the ODT, but a read error occurs (you have to expand the size of the placeholder for the document using the document selection handles.
Comment 2 Julien Nabet 2017-11-30 21:46:35 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.

Here are some traces:
com.sun.star.container.NoSuchElementException: /home/julien/lo/libreoffice/package/source/xstor/xstorage.cxx:2729: 
java stack trace:
	at com.sun.star.bridges.jni_uno.JNI_proxy.dispatch_call(Native Method)
	at com.sun.star.bridges.jni_uno.JNI_proxy.invoke(JNI_proxy.java:185)
	at com.sun.proxy.$Proxy14.isStreamElement(Unknown Source)
	at org.libreoffice.report.StorageRepository.isReadable(StorageRepository.java:166)
	at org.libreoffice.report.pentaho.output.ImageProducer.produceFromString(ImageProducer.java:334)
	at org.libreoffice.report.pentaho.output.ImageProducer.produceImage(ImageProducer.java:196)
	at org.libreoffice.report.pentaho.output.OfficeDocumentReportTarget.startImageProcessing(OfficeDocumentReportTarget.java:1288)
	at org.libreoffice.report.pentaho.output.text.TextRawReportTarget.startOther(TextRawReportTarget.java:534)
	at org.libreoffice.report.pentaho.output.OfficeDocumentReportTarget.startElement(OfficeDocumentReportTarget.java:707)
	at org.libreoffice.report.pentaho.layoutprocessor.ImageElementLayoutController.generateImage(ImageElementLayoutController.java:106)
	at org.libreoffice.report.pentaho.layoutprocessor.ImageElementLayoutController.delegateContentGeneration(ImageElementLayoutController.java:83)
	at org.libreoffice.report.pentaho.layoutprocessor.AbstractReportElementLayoutController.advance(AbstractReportElementLayoutController.java:73)
	at org.jfree.report.flow.AbstractReportProcessor.processReportRun(Unknown Source)
	at org.jfree.report.flow.SinglePassReportProcessor.processReport(Unknown Source)
	at org.libreoffice.report.pentaho.PentahoReportJob.execute(PentahoReportJob.java:338)
	at org.libreoffice.report.pentaho.SOReportJobFactory$_SOReportJobFactory.execute(SOReportJobFactory.java:217)
Comment 3 Julien Nabet 2017-12-02 07:58:30 UTC
I retested again, I could reproduce the flickering of odt image (the third one) but pdf doesn't flicker. The slight pb pdf part is the size is a bit to small so first lines are a bit mixed.

About the stacktrace I gave, I don't think it's the root cause but just a try/catch lacking

About the flickering odt image, I'd rather consider these repeated logs:
warn:legacy.osl:3878:3878:sw/source/core/graphic/ndgrf.cxx:604: Cannot swap in graphic
warn:sfx.appl:3878:3878:sfx2/source/appl/fileobj.cxx:330: Graphic error [0x8203(Error Area:Vcl Class:General Code:515)] - [file:///home/julien/lo/bugs/114057_robertpdf/ReportImage/ImagecontrolError.odt]
Comment 4 Julien Nabet 2017-12-02 08:28:21 UTC
The error is returned from https://opengrok.libreoffice.org/xref/core/vcl/source/filter/graphicfilter.cxx#1510

But investigating in this part shows that the only files considered as images are tif, png, pdf, wmf, ... but not odt.

I just wonder if the bug could be that imagecontrol shouldn't let an odt file be an image.

As a notice side I found that java stacktrace comes from https://opengrok.libreoffice.org/xref/core/reportbuilder/java/org/libreoffice/report/StorageRepository.java#179
but I suppose we want to keep it like this in case of real pbs.

Lionel: any thoughts here?
Comment 5 Robert Großkopf 2018-11-28 15:10:47 UTC
Seems the bug has been gone. Could reproduce the behaviour with LO 5.4.6, has been gone with LO 6.0.0, also 6.1.3.2 on OpenSUSE 15 64bit rpm Linux.
I will set this one to WORKSFORME.