Closed romainpiel closed 10 years ago
yep sorry, it's number 1 on my todo list for next build
Not a huge deal, glad you're working on it!
Was providing my experience in case it is a different crop on different devices.
I'm sure you've probably thought about what to do about this, but I was looking through the code that does the cropping and it doesn't quite look correct to me. Namely, it seems to end up selecting a weird part of the image to be kept, rather than the center as many people assume.
These calculations in particular are what I mean. I did some math to find values for a Nexus 5 camera size image (not what would be used for the preview image, but still helpful to demonstrate the problem), and it ends up selecting a piece of the image 160 pixels from the top, extending 878 pixels, and then leaving 402 pixels cropped off at the bottom.
Wouldn't it make more sense to do something like Math.max(0, (image.getWidth() - srcWidth)) / 2
and Math.max(0, (image.getHeight - srcHeight)) / 2
?
You're right, that's where the bug happens. I've tried your suggestion but the cropping is still wrong. I'll play with the values tonight and let you know. Thanks for your help!
Ok it should be fixed for next version. Thanks for your help @tec27! There was another issue from version 1.1.2, the preview itself was not centered.
Been working around this for a while, on my Nexus 5 the crop is about 20% cropped from the top for the screen-side camera, and 20% from the bottom for the main camera.