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 rotation of vertical labels with pillow 3.1.0 #140

Merged
merged 1 commit into from
Feb 4, 2016

Conversation

will-moore
Copy link
Member

This fixes the rotation of vertical labels when exporting as Tiff.
Noticed when testing Pillow 3.1.0 (not a problem on Pillow 2.9.0) See ome/omero-install#86

To test, create a figure with vertical labels and export as Tiff using Pillow 3.1.0 (latest version).
Check vertical labels are in correct position.

@jburel
Copy link
Member

jburel commented Feb 1, 2016

If we bump the version of pillow, we will need to release a new version of figure.
In that case, we might wait before merging ome/omero-install#86 and ome/omero-documentation#1391

@@ -1587,7 +1587,7 @@ def drawText(self, text, x, y, fontsize, rgb, align="center"):
tempLabel = Image.new('RGBA', (txt_w, txt_h), (255, 255, 255, 0))
textdraw = ImageDraw.Draw(tempLabel)
textdraw.text((0, 0), text, font=font, fill=rgb)
w = tempLabel.rotate(90)
w = tempLabel.rotate(90, expand=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this change also work with 2.9 or just 3.1?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works with 2.9 too. The API is the same, it seems that it's just the default behaviour that changed.

@jburel
Copy link
Member

jburel commented Feb 2, 2016

tested with Pillow 2.9 and Pillow 3.1
The change works with both version.

@jburel
Copy link
Member

jburel commented Feb 2, 2016

@will-moore: can we discuss the branching strategy of this repo before merging this PR?

@will-moore
Copy link
Member Author

@jburel As we discussed with @sbesson, master is the main "development" branch for figure. We will merge there and rebase the dev_1_2 branch there at the time that we want the branches to diverge.

@jburel
Copy link
Member

jburel commented Feb 4, 2016

@will-moore: sorry I thought I merged it following our discussion on branches the other day

jburel added a commit that referenced this pull request Feb 4, 2016
Fix rotation of vertical labels with pillow 3.1.0
@jburel jburel merged commit 5b619e4 into ome:master Feb 4, 2016
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.

4 participants