Haneke / HanekeSwift

A lightweight generic cache for iOS written in Swift with extra love for images.
Apache License 2.0
5.2k stars 591 forks source link

Fixes an Issue with Optionals in the Scaling function #418

Closed Nightsd01 closed 6 years ago

Nightsd01 commented 7 years ago

Currently, the hnk_imageByScaling() function assumes the successful creation of an image context. But in reality, with some image sizes, this will fail so this case should be handled

Another way to resolve this would be for applications to check for odd image sizes. Especially wide or tall images (ie. 2 x 3000) will cause this function to crash the application. But this would be better handled in Haneke itself by simply returning the original image.

dcharbonnier commented 6 years ago

please make the build pass and reopen if needed