You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi There! Before anything else, I want to thank the contributors for all the hard work into this component.
I am experiencing the following issue, in iOS 7.0:
I take a picture with the ipad rear camera
GKImageCropViewController gets pushed, with a crop size of (612, 792) (letter size paper)
I select a portion to crop, hit "use" button
The cropped image has the right aspect ratio ( 792/612 ) but wasn't cropped from the same area selected in 3)
I took pictures of grids to be really sure that (4) gets the wrong area. The origin of the cropped image nearly matches the selected area, but the size is wrong.
If between (1) and (2), I process the source image to have the aspect ratio of the target CropSize, the issue doesn't happen and I get a cropped image with the right cropped area.
the GKImageCropView.scrollView has size (612,792). the imageView has size around (592,792). The sourceImage has size (1936,2592).
the scaleWidth is calculated from the image.size and the cropSize:
CGFloat scaleWidth = self.imageToCrop.size.width / self.cropSize.width;
// then "scale" variable gets set to this value
The crop rectangle gets calculated from a transformation from scrollView to imageView
CGRect visibleRect = [scrollView convertRect:scrollView.bounds toView:imageView];
// then visibleRect gets scaled according to "scale"
So, in short, the scale gets defined with an aspect ratio from image.size/cropSize, but the crop area gets defined from scaling the result scroll view -> imageView.
Should the scaleWidth and scaleHeight be calculated from imageView.size/cropSize?
The text was updated successfully, but these errors were encountered:
Hi There! Before anything else, I want to thank the contributors for all the hard work into this component.
I am experiencing the following issue, in iOS 7.0:
I took pictures of grids to be really sure that (4) gets the wrong area. The origin of the cropped image nearly matches the selected area, but the size is wrong.
If between (1) and (2), I process the source image to have the aspect ratio of the target CropSize, the issue doesn't happen and I get a cropped image with the right cropped area.
I am pretty sure the problem is at
When debugging this method, I see:
So, in short, the scale gets defined with an aspect ratio from image.size/cropSize, but the crop area gets defined from scaling the result scroll view -> imageView.
Should the scaleWidth and scaleHeight be calculated from imageView.size/cropSize?
The text was updated successfully, but these errors were encountered: