Skip to content

CodeScannerView is unable to read barcode picked from photos gallery. #164

@theedov

Description

@theedov

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
            }
        }

Image

Note: I tried to take a picture in many different angles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions