CodeScannerView is unable to read barcode picked from photos gallery.
Getting error: .badOutput when picking a barcode from photos gallery. If I normally try to scan the same barcode, it works.
The operation couldn’t be completed. (CodeScanner.ScanError error 2.)
CodeScannerView(
codeTypes: [.upce, .ean8, .ean13, .code128, .code93, .code39],
scanMode: .oncePerCode,
shouldVibrateOnSuccess: false,
isGalleryPresented: $showGallery,
videoCaptureDevice: .systemPreferredCamera
) { response in
switch response {
case .success(let success):
barcode = success.string
image = success.image
case .failure(let failure):
print("+++ \(failure)")
break
}
}
Note: I tried to take a picture in many different angles.
Hi! @theedov Could you figure it out?
Im facing the same issue.
[error] The operation couldn’t be completed. (CodeScanner.ScanError error 2.)
Hi! @theedov Could you figure it out?
Im facing the same issue.
[error] The operation couldn’t be completed. (CodeScanner.ScanError error 2.)
Hey, no, I couldn't figure it out so I disabled the feature for now.
Same here. Tested on QR, code128 and ean13 images. QR codes seemed to work fine, but none of my tested images with code128 and ean13 worked.
Checked the source code and only a QR code detector is used, so that makes sense.
For manual picture selection I've gone a different route and added a PhotosPicker combined with VisionKit in my app.