Open NijoshNewAge opened 5 years ago
uses original size let image = info[UIImagePickerController.InfoKey.originalImage] as! UIImage
@NijoshNewAge can you provide more info?
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
let mediaType = info[UIImagePickerControllerMediaType] as! NSString
if mediaType.isEqual(to: kUTTypeImage as String) {
var imagePicked: UIImage?
if isEditing {
imagePicked = info[UIImagePickerControllerEditedImage] as? UIImage
} else {
imagePicked = info[UIImagePickerControllerOriginalImage] as? UIImage
}
picker.dismiss(animated: false) {
let imageCropViewController = UIStoryboard(name: “Main", bundle: nil).instantiateViewController(withIdentifier: "ImageCropperViewController") as! ImageCropperViewController
imageCropViewController.image = imagePicked
imageCropViewController.delegate = self
self.viewController.present(imageCropViewController, animated: true, completion: nil)
}
} else if mediaType.isEqual(to: kUTTypeMovie as String) {
let videoURL = info[UIImagePickerControllerMediaURL] as! NSURL
let thumbImage = self.createThumbImage(videoUrl: videoURL)
delegate.finishedPickingVideo!(videoUrl: videoURL, thumbImage: thumbImage)
self.viewController.dismiss(animated: true)
}
}
This was my code in that delegate. But I didn't find where that image loose its quality?.
please check which one info[] calls?
After choosing an image from UIImagePicker, which will be passed to the IGRPhotoTweakViewController. The image will be shown in there but it loses its original quality. Does anyone have the answer?