teixeiras
teixeiras

Reputation: 101

QRCode from a file using IOS 7 API

I know there is third parties alternatives, but I would like to know if it's possible using the iOS 7 API.

Since iOS 7 AVFoundation can parse QRCode in real time. Example

Is it possible to use this API but for a image in a file? Using for exemple a image as input device(?) or other solution?

Thanks for your help.

Upvotes: 5

Views: 301

Answers (1)

jcaron
jcaron

Reputation: 17720

Yes, it's possible, though you will have to use a slightly different API.

The example you linked to uses AVCaptureMetadataOutput, which makes integration easy in the AVFoundation framework, especially for real-time video.

In the case of a single still image, it's easier to use a CIDetector with the appropriate type (CIDetectorTypeQRCode).

A full example of the use of CIDetector can be found in Detecting Faces in an Image in the Core Image Programming Guide. You'll just have to switch the type you want.

Upvotes: 1

Related Questions