-
Notifications
You must be signed in to change notification settings - Fork 224
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
Is CGImageWithCorrectOrientation really necessary? #45
Labels
Comments
Indeed it is more a ground-work-ensure-all-the-things. Ideally Toucan wouldn't actually perform the operations when called, but have a more optimistic-builder-style syntax, and only perform the operations when retrieving the image property, so at that point we could optimize the callstack and remove the redundant calls.... happy for PR or hopefully I'll get there :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey! I just noticed that each operation in Toucan starts off with a call to
CGImageWithCorrectOrientation
function which involves creating a new context and drawing an image into it. So, for example, if I want to crop an image withUIImageOrientation.Left
then instead of simply cropping the image (which is extremely fast) Toucan would first physically rotate its bitmap (which is much more expensive then cropping itself) and just then crop the image. It would also change the image orientation toUIImageOrientation.Up
.I understand that it might be tempting to just "fix" an orientation so that all the other functions would only have to deal with images in
UIImageOrientation.Up
. However, if would be nice if Toucan could add a proper support for images in all orientations.The text was updated successfully, but these errors were encountered: