Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIFF export: FreeTypeFont object has no attribute getsize #522

Closed
will-moore opened this issue Oct 10, 2023 · 4 comments · Fixed by #523
Closed

TIFF export: FreeTypeFont object has no attribute getsize #522

will-moore opened this issue Oct 10, 2023 · 4 comments · Fixed by #523

Comments

@will-moore
Copy link
Member

Just tried to export a multi-page figure to TIFF on our merge-ci server, testing #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
Copy link
Member Author

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

@juliomateoslangerak
Copy link

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

@juliomateoslangerak
Copy link

juliomateoslangerak commented Feb 1, 2024

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
Copy link
Member Author

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 ome/omero-scripts#215

Ah - I realise that this should be fixed in ome/omero-scripts#214

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants