|
@@ -76,7 +76,7 @@ extension UIImage {
|
|
// the size of PNG imgaes will be scaled down
|
|
// the size of PNG imgaes will be scaled down
|
|
func scaleDownAndCompress(toMax: Float) -> UIImage? {
|
|
func scaleDownAndCompress(toMax: Float) -> UIImage? {
|
|
let rect = getResizedRectangle(toMax: self.isTransparent() ?
|
|
let rect = getResizedRectangle(toMax: self.isTransparent() ?
|
|
- Float(min(self.size.width / 2, CGFloat(toMax / 2))) :
|
|
|
|
|
|
+ min(Float(self.size.width) / 2, toMax / 2) :
|
|
toMax)
|
|
toMax)
|
|
|
|
|
|
UIGraphicsBeginImageContextWithOptions(rect.size, !self.isTransparent(), 0.0)
|
|
UIGraphicsBeginImageContextWithOptions(rect.size, !self.isTransparent(), 0.0)
|