Browse Source

환부이미지 촬영 이미지 리사이즈 640 -> 1280 변경

서용하 6 years ago
parent
commit
dff0d8b797

+ 1 - 1
MCPlus/SwiftExtension/ExtensionUIImage.swift

@@ -5,7 +5,7 @@ import UIKit
 extension UIImage {
     
     func scaleToSize(newSize: CGSize) -> UIImage {
-        UIGraphicsBeginImageContextWithOptions(newSize, false, 0.0)
+        UIGraphicsBeginImageContextWithOptions(newSize, true, scale)
         draw(in: CGRect(x: 0, y: 0, width: newSize.width, height: newSize.height))
         let newImage: UIImage = UIGraphicsGetImageFromCurrentImageContext()!
         UIGraphicsEndImageContext();

+ 2 - 2
MCPlus/ViewControllers/CustomCameraViewController.swift

@@ -242,8 +242,8 @@ extension CustomCameraViewController{
         let width = image.size.width
         let height = image.size.height
         var ratio:CGFloat = 1.0
-        if width > 640{
-            ratio = width / 640
+        if width > 1280{
+            ratio = width / 1280
         }
         
         return image.scaleToSize(newSize: CGSize(width: width / ratio, height: height / ratio))