Skip to content

Commit

Permalink
Ensure images have a rendering definition before generating the thumb…
Browse files Browse the repository at this point in the history
…nail

Update the test_per_image logic to read the return value of ThumbnailStore.setPixelsId()
and call ThumbnailStore.resetDefaults() if necessary
  • Loading branch information
sbesson committed May 29, 2024
1 parent 89258f3 commit 417776d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/omero_cli_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,8 +809,16 @@ def test_per_image(self, client, img, force, thumb):
elif thumb:
tb = client.sf.createThumbnailStore()
try:
tb.setPixelsId(int(pixid), ctx)
tb.getThumbnailByLongestSide(rint(96), ctx)
has_rendering_settings = tb.setPixelsId(int(pixid), ctx)
if not has_rendering_settings:
try:
tb.resetDefaults(ctx)
tb.getThumbnailByLongestSide(rint(96), ctx)
except Exception as e:
msg = "fail:"
error = e
else:
tb.getThumbnailByLongestSide(rint(96), ctx)
finally:
tb.close()

Expand Down

0 comments on commit 417776d

Please sign in to comment.