简体   繁体   English

允许编辑错误的UIImagePickerController裁剪图像,在顶部留下黑条

[英]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. 我正在iPad上的popover中使用UIImagePickerController与前置摄像头拍照。 I set allowsEditing to YES and get the awesome built in "Move and Scale" view after taking the picture. 我将allowsEditing设置为YES,并在拍摄照片后获得内置的“移动和缩放”视图中的精彩内容。 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 ). 尽管图像被裁剪为320x320平方( http://dl.dropbox.com/u/2246698/moveAndScale.png ),但此视图中的裁剪矩形在屏幕上测量为320x267。 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 ). 如果我按原样接受图像而不调整大小或移动它,顶部有一个约25像素高的黑条,好像裁剪矩形在图像上的位置太高( 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. 实际上,如果我从媒体信息字典中获取该裁剪矩形(通过UIImagePickerControllerCropRect),则表明裁剪矩形的y原点为-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. 非常感谢。

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. 它必须是一个bug,但如果是,我不知道为什么更多的人不抱怨它。 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. 事情就是无用的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM