I use the category shown here in https://stackoverflow.com/a/10491692/1271826 which is a category that provides UIImage
a series of resizing methods, which effectively supports UIViewContentModeScaleToFill
, UIViewContentModeScaleAspectFill
, and UIViewContentModeScaleAspectFit
.
I use this primarily for creating my thumbnail images (using my imageByScalingAspectFillSize
) and do this with images of varying formats without incident.