Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Card.IO locks the focus #17

Closed
hjunaid opened this issue Mar 5, 2015 · 4 comments
Closed

Card.IO locks the focus #17

hjunaid opened this issue Mar 5, 2015 · 4 comments

Comments

@hjunaid
Copy link

hjunaid commented Mar 5, 2015

Card.IO locks the focus and does not unlock it after use. This throws up issues when using other libraries - i am using Jumio Netverify to OCR identity documents. After using Card.IO in the same cordova app, Jumio SDK is unable to focus properly.

Could you please pinpoint where the issue is and how we reset the focus and other setting to default values?

I am happy to fix and create a pull request ..

Many thanks,
Junaid

@hjunaid
Copy link
Author

hjunaid commented Mar 5, 2015

Ok, so i have figured it out. I am forcing focus settings of the device after card read to get Jumio SDK to work .

  NSError *error = nil;
    //Set the device setting back to default - Bug in Jumio library 
    AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];

    if ([device respondsToSelector:@selector(isAutoFocusRangeRestrictionSupported)]
        && device.autoFocusRangeRestrictionSupported
        && [device lockForConfiguration:&error]) {
        [device setAutoFocusRangeRestriction:AVCaptureAutoFocusRangeRestrictionNone];
        [device unlockForConfiguration];
    }

@dgoldman-pdx
Copy link
Member

Thanks, @junaidabidi!

So your suggestion is that card.io should include essentially the above code when it is finished with the camera?

@hjunaid
Copy link
Author

hjunaid commented Mar 5, 2015

Yeah, it will be great to leave the setting to default value as other libraries might assume the camera to be in default state (ideally they should initialise it properly but there you go ).

@dgoldman-pdx
Copy link
Member

Now officially released

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

No branches or pull requests

2 participants