Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Cropped Image issue #75

Open
sebacura opened this issue Nov 23, 2020 · 2 comments
Open

Cropped Image issue #75

sebacura opened this issue Nov 23, 2020 · 2 comments

Comments

@sebacura
Copy link

Hello,

I'm trying to use the library with a Samsung Galaxy A5 2017 and the cropped image not work correctly (even though the rectangle is recognized correctly):

image

When I use with a Samsung Galaxy s9 Plus it wok correctly:
image

Do you have an idea what could cause that ?

Sebastian

@humphreyja
Copy link
Member

@sebacura Thanks for trying out the package. As I'm sure you've tried other packages for solving this issue, most of the packages for image detection and cropping are pretty buggy. I actually rebuilt this one from the ground up while most are just forks based off of a gist from some random android dev (seriously). So while I solved plenty of the bugs there are still some minor nuances that show up and this is one of them.

Android has an interesting api for interacting with the camera. There's a preview screen size and a captured image screen size that you need to set up. These can be different ratios and different resolutions. This package has code to handle transforming the detected area coordinates to map to the captured image size and ratio but every so often I've found it to be a little off in Android and honestly I am not sure why. What I think it is is something to do with the actual hardware of the device and how it is reporting the camera output to the code. This is why it is different from device to device (and why developing for iPhones is so much easier because everything is consistent).

So probably not the answer you are looking for but that is the honest answer.

One thing I tell everyone who has issues with this package is to try to only use the package at 100% screen size (no headers or footers) because sometimes that will skew the images or at least when I tested this on a variety of phones, that is what was the most consistent at working. (I use this package in production!) I did notice that usually issues were isolated to older android phones.

If you have any android dev experience I'd love for you to take a crack at this. I believe I structured the code fairly readable.

@ShipanLiu
Copy link

ShipanLiu commented Aug 5, 2021

you should change some styles: <Image resizeMode='contain'> I also met up with this problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants