yushulx / flutter_barcode_sdk

Build barcode QR detection apps for Windows, Linux, macOS, Android, iOS and web.
https://pub.dev/packages/flutter_barcode_sdk
MIT License
47 stars 18 forks source link

Get raw bytes when reading DataMatrix format #34

Closed kaciula closed 1 year ago

kaciula commented 1 year ago

I am reading a DataMatrix file and the result is stored in BarcodeResult as a String field called text. However, the data stored in the DataMatrix is data compressed with zip.

I need to get the exact raw bytes stored in DataMatrix and not a String that has probably been encoded/decoded from the raw bytes and has been altered.

Can you help?

yushulx commented 1 year ago

@kaciula I see. I'll add a new property for raw data. I may release an update next week.

yushulx commented 1 year ago

@kaciula you can update the SDK now. image

kaciula commented 1 year ago

@yushulx Thanks for the update. Unfortunately, the raw bytes aren't exactly correct. I'm attaching a DataMatrix code for testing purposes.

The correct raw bytes start with: [80, 75, 3, 4, 45, 0, 0, 0, 8, 0, 123, 103, 51, 85, 94, 208, 14, 42, 255, 255, 255, 255, 255, 255, 255, 255, 5, 0, 20, 0, 97, 114, 114, 97, 121, 1, 0, 16, 0, 146, etc.

RIght now, the plugin returns the following raw bytes: [80, 75, 3, 4, 45, 8, 123, 103, 51, 85, 94, 239, 191, 189, 14, 42, 239, 191, 189, 239, 191, 189, 239, 191, 189, 239, 191, 189, 239, 191, 189, 239, 191, 189, 239, etc.

It seems the problem starts when the plugin reaches the first 0 byte. It seems like it skips all zeroes.

Let me know if you need any more info from me.

barcode
yushulx commented 1 year ago

@kaciula I've tested your image on windows desktop and web.

Windows

image

Web

image
kaciula commented 1 year ago

@yushulx The issue I am reporting is for Android and iOS.

kaciula commented 1 year ago

@yushulx I realized that I am actually using flutter_camera_qrcode_scanner package. Can you please update that package also with the changes?

yushulx commented 1 year ago

@kaciula flutter_camera_qrcode_scanner is my personal open source project. I suggest you can use the official package - https://pub.dev/packages/dynamsoft_capture_vision_flutter, which is maintained by Dynamsoft R&D. I'm currently investigating your issue.

kaciula commented 1 year ago

@yushulx Aha. I understand now. I've now tested this package separately and the raw bytes are received correctly. Sorry for the confusion.

Does the official camera package use the latest skd so I can get the raw bytes with that package also?

yushulx commented 1 year ago

@kaciula yes. https://www.dynamsoft.com/capture-vision/docs/programming/flutter/api-reference/class-barcode-result.html?ver=latest