flutter_zxing icon indicating copy to clipboard operation
flutter_zxing copied to clipboard

Changing the ReaderWidget resolution from HIGH to MAX makes no difference

Open talalong opened this issue 2 years ago • 1 comments

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 avatar May 28 '23 21:05 talalong

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

talalong avatar Jun 04 '23 20:06 talalong