[ome-users] OMERO.figure: export to PDF fails

Rainer Poehlmann rainer.poehlmann at unibas.ch
Tue Jan 23 12:31:54 GMT 2018


Hi Will,

thanks a lot for reproducing and filing of the bug.

> However, you may find that the quickest workaround for you
> is to try reportlab 3.2.0.

Just downgraded reportlab to version 3.2.0 and the questionable Figure PDF export now succeeds!

This did help a lot ;-)

Cheers,
-Rainer


>> On 23 Jan 2018, at 10:12, Kai Schleicher <kai.schleicher at unibas.ch <mailto:kai.schleicher at unibas.ch>> wrote:
>>
>> Hi Will,
>>
>> thanks for you quick reply! Please find my answers in-line:
>>
>>
>>>  I just checked and there’s certainly not a limit of 18 panels on a page. Exporting a PDF page with 40 panels worked 
>>> OK for me.
>> Thanks for testing.
>>
>>
>>> Could you let me know your reportlab version?
>> $ pip freeze | grep reportlab
>> reportlab==3.4.0
>>
>> we have a higher version, could that be an issue?
>>
>>
>>> Also, is this a multi-page figure?
>>> Are all the panels within a single page?
>>
>> It is a single-page figure. I also tried dividing the panels on two pages, but received the same error.
>>
>>
>>> I wonder if the presence of the 19th panel would cause this bug if there were only 1 or 2 of other panels there?
>> no, if only 1 or 2 panels are there than the 19th does not cause the bug. In fact it does not matter *which* panels 
>> are present or deleted, it just fails if its more than 18. I will sent you the images in question in a separate email, 
>> maybe you can reproduce the bug this way on your end.
>>
>>
>>> If you can reproduce this, especially with a simpler figure that would be great.
>> I did not manage to reproduce it with other data - but I could reproduce it using the exact same images from the user.
>>
>>
>>> If you could send me the exported JSON “File > Export as json” that fails, and one that doesn’t, that would be handy
>>> (either privately or remove any private names / details).
>> I will include the json files in the separate email together with the images that cause the bug.
>>
>> Thanks again and cheers,
>> Kai
>>
>> On 01/22/2018 06:04 PM, William Moore (Staff) wrote:
>>> Hi Kai,
>>>
>>>  I just checked and there’s certainly not a limit of 18 panels on a page. Exporting a PDF page with 40 panels worked 
>>> OK for me.
>>>
>>> Could you let me know your reportlab version?
>>> I have:
>>>
>>> $ pip freeze | grep reportlab
>>> reportlab==3.2.0
>>>
>>> Also, is this a multi-page figure?
>>> Are all the panels within a single page?
>>>
>>> I wonder if the presence of the 19th panel would cause this bug if there were only 1 or 2 of other panels there?
>>>
>>> If you can reproduce this, especially with a simpler figure that would be great.
>>>
>>> If you could send me the exported JSON “File > Export as json” that fails, and one that doesn’t, that would be handy
>>> (either privately or remove any private names / details).
>>>
>>>  Cheers,
>>>
>>>   Will.
>>>
>>>
>>>> On 22 Jan 2018, at 16:28, Kai Schleicher <kai.schleicher at unibas.ch <mailto:kai.schleicher at unibas.ch>> wrote:
>>>>
>>>> Dear OME team,
>>>>
>>>> first of all, I wish you a happy new year and best of success for 2018!
>>>>
>>>> Coming to my question, we were contacted by a OMERO.figure user who noticed that the "export to pdf" function failed 
>>>> when too many images are present in the figure (A4, vertical).
>>>>
>>>> To be precises, 18 images á 512x512 pixels can still be exported, while export fails with 19 or more images of the 
>>>> same dimensions, see error logs below
>>>>
>>>>> Traceback (most recent call last):
>>>>>   File "./script", line 1875, in <module>
>>>>>     run_script()
>>>>>   File "./script", line 1861, in run_script
>>>>>     file_annotation = export_figure(conn, script_params)
>>>>>   File "./script", line 1818, in export_figure
>>>>>     return fig_export.build_figure()
>>>>>   File "./script", line 704, in build_figure
>>>>>     self.save_figure()
>>>>>   File "./script", line 1372, in save_figure
>>>>>     self.figure_canvas.save()
>>>>>   File "/home/omeronas/omeroweb/lib/python2.7/site-packages/reportlab/pdfgen/canvas.py", line 1237, in save
>>>>>     self._doc.SaveToFile(self._filename, self)
>>>>>   File "/home/omeronas/omeroweb/lib/python2.7/site-packages/reportlab/pdfbase/pdfdoc.py", line 211, in SaveToFile
>>>>>     raise RuntimeError("class %s instances can only be saved once" % self.__class__.__name__)
>>>>> RuntimeError: class PDFDocument instances can only be saved once
>>>>
>>>> Is there maybe a limitation concerning the amount of pixels/images?
>>>>
>>>> I also attached an example Blitz0.log file when running the PDF export from the Figure file in question.
>>>>
>>>> Thank you for your help and cheers,
>>>> Kai
>>>>
>>>> -- 
>>>>>> Please note my NEW PHONE NUMBERS: +41 61 207 57 31 (direct) +41 61 207 22 50 (central)<<
>>>> Kai Schleicher, PhD | Research Associate in Advanced Light Microscopy | Biozentrum, University of Basel | 
>>>> Klingelbergstrasse 50/70 | CH-4056 Basel |
>>>> Phone: +41 61 207 57 31 (direct) +41 61 207 22 50 (central) | kai.schleicher at unibas.ch 
>>>> <mailto:kai.schleicher at unibas.ch> | www.biozentrum.unibas.ch <http://www.biozentrum.unibas.ch/> | 
>>>> www.microscopynetwork.unibas.ch <http://www.microscopynetwork.unibas.ch/>
>>>>
>>>> <OMERO_ExportPDF_Error_Blitz.log>_______________________________________________
>>>> ome-users mailing list
>>>> ome-users at lists.openmicroscopy.org.uk <mailto:ome-users at lists.openmicroscopy.org.uk>
>>>> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
>>>
>>>
>>> The University of Dundee is a registered Scottish Charity, No: SC015096
>>>
>>>
>>> _______________________________________________
>>> ome-users mailing list
>>> ome-users at lists.openmicroscopy.org.uk
>>> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
>>
>> _______________________________________________
>> ome-users mailing list
>> ome-users at lists.openmicroscopy.org.uk <mailto:ome-users at lists.openmicroscopy.org.uk>
>> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
> 
> 
> The University of Dundee is a registered Scottish Charity, No: SC015096
> 
> 
> _______________________________________________
> ome-users mailing list
> ome-users at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
> 


More information about the ome-users mailing list