Skip to content

Conversation

@homm
Copy link
Member

@homm homm commented Jun 3, 2016

Internal transform API was very confusing. For example, rotate method was calling self.transform or self.im.rotate depends on expand argument, but self.im.rotate internally also calls ImagingTransformAffine, so it was excessive.

Changes proposed in this pull request:

  • First of all, this PR fixes rotations bug Image.rotate(90*n, expand=True) results in translation and expansion #1917 in two ways:
    • It really uses very cheap transpose operations if it is possible regardless of filter. 8203a43
    • It rounds coefficients in the transform matrix, so even if we are not using cheap transpose, we still get right dimensions because cos(90°) now is exactly 0, not 6.123e-17. 7687ce8
  • Image.rotate always uses self.transform, so im.rotate was removed from core library. 709078e 1f8c252
  • The order of coefficients in internal API now match matrix representation and order of external API. 2b77b1c 3d622d6
  • Internal ImagingTransformAffine, ImagingTransformPerspective and ImagingTransformQuad was replaced with one entry point to all transformations: ImagingTransform. Former ImagingTransform was renamed to ImagingGenericTransform and removed from extern symbols (Imaging.h file). 6be3df2 9902d2e

@coveralls
Copy link

coveralls commented Jun 3, 2016

Coverage Status

Changes Unknown when pulling 5756321 on uploadcare:cleanup-transforms into * on python-pillow:master*.

@homm homm force-pushed the cleanup-transforms branch from 5756321 to 3d622d6 Compare June 8, 2016 13:18
@homm
Copy link
Member Author

homm commented Jun 8, 2016

rebased

PIL/Image.py Outdated
data = (xs, 0, x0 + xs/2, 0, ys, y0 + ys/2)

elif method == PERSPECTIVE:
# change argument order to match implementation
Copy link
Member

Choose a reason for hiding this comment

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

This comment doesn't apply anymore, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, removed

@homm
Copy link
Member Author

homm commented Jun 9, 2016

Links to commits in the description are updated.

@homm homm added this to the 3.3.0 milestone Jun 9, 2016
@wiredfool wiredfool merged commit ebd3c35 into python-pillow:master Jun 11, 2016
@homm homm deleted the cleanup-transforms branch June 15, 2016 00:16
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.

3 participants