khoren93 / flutter_zxing

Flutter plugin for scanning and generating QR codes using the ZXing library, supporting Android, iOS, and desktop platforms
https://pub.dev/packages/flutter_zxing
MIT License
89 stars 50 forks source link

Changing the ReaderWidget resolution from HIGH to MAX makes no difference #95

Open talalong opened 1 year ago

talalong commented 1 year ago

Hello, Based on the requirements, I need to change the camera resolution from high to max. However, there is no noticeable difference in the preview image, and the scanning performance has not improved. Therefore, I assume that this could be a bug.

The third picture shows me using the default camera preview from the camera library. As you can see, the text is clearer and not blurred.

I am using version 1.1.2. This is my code:

Widget build(BuildContext context) {
    return Scaffold(
      appBar: const OdetteAppBar(title: "Test DMC"),
      body: ReaderWidget(
        tryHarder: true,
        scanDelay: const Duration(milliseconds: 100),
        scanDelaySuccess: const Duration(milliseconds: 500),
        resolution: ResolutionPreset.max,
        isMultiScan: false,
        codeFormat: Format.dataMatrix,
        cropPercent: 0.6,
        showGallery: false,
        showToggleCamera: false,
        scannerOverlay: const FixedScannerOverlay(),
        onControllerCreated: (controller) async {
          if (controller != null) {
            _controller = controller;
          }
        },
        onScanFailure: _onScanFailure,
        onScan: (code) async {
          await _controller.pausePreview();
          _onScanSuccess(code);
        },
      ),
    );
  }

Screenshot_20230528-215012

Screenshot_20230528-215125

Screenshot_20230528-222014

talalong commented 1 year ago

OK, I delved deeper into the source code and discovered that there is an issue with the startImageStream method in the core camera package of Flutter. The problem was reported 2 years ago and has not been resolved yet.

Here is the link to the open issue: GitHub Issue #78247