You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 with UIImageOrientation.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 to UIImageOrientation.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:
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 :)
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: