Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIImagePickerController that allowsEditing incorrectly crops the image leaving a black bar across the top

I'm using UIImagePickerController in a popover on the iPad to take a picture with the front camera. I set allowsEditing to YES and get the awesome built in "Move and Scale" view after taking the picture. The crop rectangle in this view measures 320x267 on the screen despite the fact that the image is cropped to a 320x320 square (http://dl.dropbox.com/u/2246698/moveAndScale.png). If i accept the image as is without resizing or moving it, there is a ~25px high black bar across the top as if the crop rectangle has been positioned too high on the image (http://dl.dropbox.com/u/2246698/cropped.png). In fact, if i get that crop rectangle from the media info dictionary (via UIImagePickerControllerCropRect) it shows that the y origin of the crop rectangle is at -39. This seems broken that the image would be incorrectly cropped by default and usually when it seems broken it's because i did it wrong. Has anyone ever seen this or know of some setting to twiddle that will be good for my crops?

Many thanks.

like image 785
kalperin Avatar asked Aug 23 '11 15:08

kalperin


1 Answers

I see the exact same behavior. It MUST be a bug, but if it is, I don't know why more people aren't complaining about it. Another problem with it is that you can't move the picture to the edges to crop to include that part--it always slides back to the middle.

If you zoom it, then you can move it, but you can never move it far enough to be able to include the left or right edges.

The thing is next to useless.

like image 177
Paul Bruneau Avatar answered Sep 29 '22 10:09

Paul Bruneau