@@ -27,23 +27,23 @@ extension UIImage {
2727 guard let cgImage2 = ciContext. createCGImage ( resultImage, from: inputImage. extent) else { return self }
2828 return UIImage ( cgImage: cgImage2)
2929 }
30-
30+
3131 /**
3232 * @desc lighter image
3333 * @param {CGFloat} percentage,
3434 */
3535 func lighter( by percentage: CGFloat = 30 ) -> UIImage ? {
3636 return self . adjust ( by: abs ( percentage) )
3737 }
38-
38+
3939 /**
4040 * @desc darker image
4141 * @param {CGFloat} percentage,
4242 */
4343 func darker( by percentage: CGFloat = 30 ) -> UIImage ? {
4444 return self . adjust ( by: - 1 * abs( percentage) )
4545 }
46-
46+
4747 /**
4848 * @desc adjust image darkness / lightness from coefficient
4949 * @param {CGFloat} percentage,
@@ -59,7 +59,7 @@ extension UIImage {
5959 guard let cgImage2 = ciContext. createCGImage ( resultImage, from: inputImage. extent) else { return self }
6060 return UIImage ( cgImage: cgImage2)
6161 }
62-
62+
6363 /**
6464 * @desc adjust image orientation if needed in exif
6565 */
@@ -75,7 +75,7 @@ extension UIImage {
7575 return result
7676 }
7777 }
78-
78+
7979 /**
8080 * @desc resizeImage width max target Size
8181 */
@@ -85,12 +85,12 @@ extension UIImage {
8585 let heightRatio = targetSize. height / size. height
8686 let newSize = widthRatio > heightRatio ? CGSize ( width: size. width * heightRatio, height: size. height * heightRatio) : CGSize ( width: size. width * widthRatio, height: size. height * widthRatio)
8787 let rect = CGRect ( x: 0 , y: 0 , width: newSize. width, height: newSize. height)
88-
88+
8989 UIGraphicsBeginImageContextWithOptions ( newSize, false , 1.0 )
9090 self . draw ( in: rect)
9191 let newImage = UIGraphicsGetImageFromCurrentImageContext ( )
9292 UIGraphicsEndImageContext ( )
93-
93+
9494 return newImage
9595 }
9696}
0 commit comments