NeutrinosPlatform / cordova-plugin-document-scanner

cordova plugin for document scan
https://www.neutrinos.co/
MIT License
85 stars 59 forks source link

v4.X iPhone X Unsupported #55

Open joeldhenry opened 5 years ago

joeldhenry commented 5 years ago

the view is stretched, and makes the plugin unusable on iPhone X

https://github.com/charlymr/IRLDocumentScanner/issues/29

ChrisTomAlx commented 5 years ago

Hey @joeldhenry

Thanks for raising this issue. Also thanks for linking the issue to the original library. I have requested some help from the original library creator, but I guess he is too busy, so I will look into this as and when I am able to.

Cheers! Chris Neutrinos

Suzzak commented 4 years ago

Same problem with iOS but I take the opportunity to tell you that your plugin is incredibly effective, I love it. Thanks to you!

MimoGraphix commented 3 years ago

Hi @ChrisTomAlx

I think I was able to fix this issue. Problem is that iOS is capturing photos in ratio 4:3 but ImageView in the plugin is scaling the image to the full view

Changes I made are simple: IRLCameraView.m:~152 -> UIImageView *view = [[UIImageView alloc] initWithFrame:self.bounds]; view.transform = CGAffineTransformMakeScale(1.0f, 0.75f); // this is what I added which is basically transforming image to 4:3 scale

and the same one I used in

IRLCameraView.m:~218 -> GLKView *view = [[GLKView alloc] initWithFrame:self.bounds]; view.transform = CGAffineTransformMakeScale(1.0f, 0.75f);

Please let me know if this fix worked also for you...