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

Fix shape_thumbnail using integer division #137

Merged
merged 1 commit into from
Feb 26, 2020

Conversation

will-moore
Copy link
Member

Fixes the rendering of shape thumbnails in old viewer.

This was previously failing when using python 2 division in python 3 gives floats not int:

File "/Users/wmoore/Desktop/WEB/omero-web/omeroweb/webgateway/views.py" in render_shape_thumbnail
  483.     return get_shape_thumbnail(request, conn, image, shape, compress_quality)

File "/Users/wmoore/Desktop/WEB/omero-web/omeroweb/webgateway/views.py" in get_shape_thumbnail
  633.         xs_image = Image.new('RGB', (xs_w, xs_h), bg_color)

File "/Users/wmoore/opt/miniconda3/envs/omeroweb/lib/python3.6/site-packages/PIL/Image.py" in new
  2544.     return im._new(core.fill(mode, size, color))

Exception Type: TypeError at /webgateway/render_shape_thumbnail/0175127/
Exception Value: integer argument expected, got float

To test, view shape thumbnail in old viewer.

@jburel
Copy link
Member

jburel commented Feb 26, 2020

Checked yesterday without this PR and the preview of the shapes did not work
Checked today and it works fine with this PR.
Shapes created by iviewer and not correctly displayed in the old viewer.
I will create an issue. This is a problem since users have requested a read-only view of the rois in the preview tab of the datamanager

Screenshot 2020-02-26 at 09 04 54

@jburel jburel merged commit 0c5223c into ome:master Feb 26, 2020
@will-moore will-moore deleted the shape_thumbnail_fix branch February 26, 2020 09:23
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 this pull request may close these issues.

None yet

2 participants