Closed miaotaoii closed 5 years ago
前置相机拍照后剪裁时,剪裁出的结果上下是反的
@miaotaoii Please, use English. Also, could you provide an example of what you expect and what you have?
I think u can check the exif info with the image , if the orientation/rotation of image is wrong , fix it by your own func.
I just crop photo use RSKImageCropViewController.cropImage(), and then get the result in func imageCropViewController(_ controller: RSKImageCropViewController, didCropImage croppedImage: UIImage, usingCropRect cropRect: CGRect) { ... }. without changing orientation or rotation
here is my code :
@objc func cropBtnClicked(){
super.cropImage()
}
func imageCropViewController(_ controller: RSKImageCropViewController, didCropImage croppedImage: UIImage, usingCropRect cropRect: CGRect) {
let photoVc = PreViewPhotoViewController(image: croppedImage, imageRect : cropRect )
photoVc.hidesBottomBarWhenPushed = true
self.navigationController?.pushViewController(photoVc, animated: true)
}
func prepareImage(){
let scale : CGFloat = 0.16
let yy = ScreenUtils.getHeight() * scale
MLog.log(tag: TAG, logStr : "y : \(yy) backgroundImage.size.height \(backgroundImage.size.height) ")
let photoView = UIImageView()
photoView.contentMode = .scaleAspectFill
photoView.image = backgroundImage
photoView.frame = CGRect(x: 0, y: yy, width: ScreenUtils.getWidth(), height: 300)
view.addSubview(photoView)
}
can u help me with this problem ? @ruslanskorb @uestchang
@miaotaoii Check the image you are using to initialize RSKImageCropViewController
. Does it have the correct orientation? Check the image you are getting in didCropImage:...
method of RSKImageCropViewControllerDelegate
. Does it have the correct orientation? Also, could you provide a sample project that reproduces your problem?
thanks ,maybe not crop problem I think, I will find out it later
前置相机拍照后剪裁时,剪裁出的结果上下时反的