journeyapps / zxing-android-embedded

Barcode scanner library for Android, based on the ZXing decoder
https://journeyapps.com/
Apache License 2.0
5.68k stars 1.26k forks source link

scan inverted custom view #656

Closed openmotion closed 2 years ago

openmotion commented 2 years ago

Description of the problem:

with a custom view i cannot scan inverted qrcode

` barcodeScannerView = findViewById(R.id.zxing_barcode_scanner);

    CameraSettings settings = new CameraSettings();
    settings.setScanInverted(true);

   barcodeScannerView.setCameraSettings(settings);

    barcodeScannerView.setTorchListener(this);

    barcodeScannerView.getCameraSettings().setScanInverted(true);

    barcodeScannerView.getCameraSettings().setExposureEnabled(true);

    barcodeScannerView.initializeFromIntent(getIntent());

    Collection<BarcodeFormat> formats = Arrays.asList(BarcodeFormat.QR_CODE, BarcodeFormat.CODE_39);
    barcodeScannerView.setDecoderFactory(new DefaultDecoderFactory(formats));

    barcodeScannerView.decodeContinuous(callback);

    switchFlashlightButton = findViewById(R.id.switch_flashlight);
    viewfinderView = findViewById(R.id.zxing_viewfinder_view);

    // if the device does not have flashlight in its camera,
    // then remove the switch flashlight button...
    if (!hasFlash()) {
        switchFlashlightButton.setVisibility(View.GONE);
    }

    capture = new CaptureManager(this, barcodeScannerView);`

Which library version are you using? E.g. 3.2.0. implementation('com.journeyapps:zxing-android-embedded:4.2.0') { transitive = false } implementation 'com.google.zxing:core:3.3.0'

Which phone/tablet are you using, and which Android version does it run? (e.g. Samsung Galaxy S5, Android 5.0) android 10 Does the same happen on other devices or an emulator? don't know Can you reproduce the issue in the sample project included with the library? If not, can you provide your own sample project or sample code that produces this error?

In the case of an error do you have a stack trace or adb logs?

saba7afi commented 2 years ago

any update please, I've the same issue.

rkistner commented 2 years ago

Need more details here.

Does it work in the sample app (https://github.com/journeyapps/zxing-android-embedded/releases/tag/v4.3.0), but not with a custom view? Or not at all?

Do you have a sample of a barcode that fails to scan?

Are there any errors, or does it just not detect the barcode?

openmotion commented 2 years ago

the sample app doesn"t have the custom example with the inverted option