Closed knabar closed 5 years ago
Comparing both web-latest and web-merge No obvious regression in the exported figure I noticed a problem exporting as TIFF see screenshot (left export, right figure)
Seems that the issue @jburel noticed above is due to this PR. Tried exporting same figure with script from origin/master (left) and then from this branch (right). NB: also noticed a truncation of the purple Polylline.
The truncation is due to the large stroke width and the temporary canvas used to draw on not having enough buffer around the shape. Should be easy to resolve once I get back.
On Aug 6, 2018, at 11:30 AM, Will Moore notifications@github.com wrote:
Seems that the issue @jburel noticed above is due to this PR. Tried exporting same figure with script from origin/master (left) and then from this branch (right). NB: also noticed a truncation of the purple Polylline.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Rebased on top of 4.0.1 and fixed the offset/cropping issue when drawing polygons
@knabar is it ready for review?
@jburel Yes, apologies for not explicitly stating so
This has fixed the issue we were seeing above. The only problem I'm seeing now is that the rectangle corners are rounded in TIFF export because of the way that we're drawing polygons.
For rotated rectangles (which we don't yet support in the web UI) it may be harder find a workaround so I guess it's OK to use the polygon method, but if there's no rotation then I think it would be nice to preserve the current behaviour.
I also tested with a rotated image (not rotated rectangles) and it's working fine:
@will-moore Thanks. I'll check out the rectangle issue to see if there's an easy fix for both unrotated and rotated.
Apparently yesterday a PR was merged into Pillow to draw nicer polyline joints, but they chose rounded joints also: https://github.com/python-pillow/Pillow/pull/3250
@will-moore @jburel I changed rectangle drawing for Pillow back to a custom method to get squared corners. Ready for another review.
This is working nicely for me now. But travis is complaining:
./omero_figure/scripts/omero/figure_scripts/Figure_To_Pdf.py:669:5: E303 too many blank lines (2)
Otherwise, good to merge.
@will-moore Fixed the blank line
This is also working on web-dev-merge now too. Good to merge.
This PR includes additional functionality for the PDF/TIFF export:
None of these changes should impact the current export behavior for a given figure, though I need to do some more thorough testing.
Especially shape label rendering will need some more work, but opening the PR now for early review.