ome / omero-figure

An OMERO.web app for creating Figures from images in OMERO
http://figure.openmicroscopy.org
GNU Affero General Public License v3.0
15 stars 30 forks source link

TIFF export: FreeTypeFont object has no attribute getsize #522

Closed will-moore closed 7 months ago

will-moore commented 8 months ago

Just tried to export a multi-page figure to TIFF on our merge-ci server, testing https://github.com/ome/omero-figure/pull/519:

Traceback (most recent call last):
  File "./script", line 2530, in <module>
    run_script()
  File "./script", line 2516, in run_script
    file_annotation = export_figure(conn, script_params)
  File "./script", line 2472, in export_figure
    return fig_export.build_figure()
  File "./script", line 978, in build_figure
    self.add_panels_to_page(panels_json, image_ids, page)
  File "./script", line 1971, in add_panels_to_page
    self.draw_labels(panel, page)
  File "./script", line 1405, in draw_labels
    draw_lab(l, lx, ly, align='right-vertical')
  File "./script", line 1332, in draw_lab
    self.draw_text(text, lx, ly, fontsize, rgb, align=align)
  File "./script", line 2327, in draw_text
    temp_label = self.draw_temp_label(text, fontsize, rgb)
  File "./script", line 2251, in draw_temp_label
    txt_w, txt_h = font.getsize(t['text'])
AttributeError: 'FreeTypeFont' object has no attribute 'getsize'
will-moore commented 8 months ago

TIFF export with labels is still working on our production "nightshade" server, so may be due to more recent versions of Pillow etc?

juliomateoslangerak commented 5 months ago

Hi, This issue is affecting the "Publishing Option>split view figure" script

juliomateoslangerak commented 5 months ago

Hi @will-moore, do you think it is possible to make a release with this fix? we are getting quite some users that, for one issue or another, want to export in tiff. Good to know anyway that we have to do some training to push pdf.

will-moore commented 5 months ago

Hi @juliomateoslangerak - Thanks for reporting that. This issue is fixed in OMERO.figure and recently released. But I'm guessing you're talking about "Split View Figure" where I've just created an issue https://github.com/ome/omero-scripts/issues/215

Ah - I realise that this should be fixed in https://github.com/ome/omero-scripts/pull/214