rhymelph / r_scan

📷🖨Flutter二维码&条形码扫描插件,支持相机、文件、链接、Uint8List类型扫描
https://juejin.im/post/5dd8efb1e51d452314438515
BSD 3-Clause "New" or "Revised" License
119 stars 79 forks source link

[Bug] Getting libjpeg error when trying to scan images taken from camera #55

Closed chaudharydeepanshu closed 2 years ago

chaudharydeepanshu commented 3 years ago

Hello, thanks for working on this plugin. I have been using this plugin to scan images from path but I'm receiving this error when trying to scan images taken through the camera,

D/skia ( 6159): libjpeg error 116 <Corrupt JPEG data: 18 extraneous bytes before marker 0xdb> from output_message W/System ( 6159): A resource failed to call close. I/flutter ( 6159): TypedDataView(cid: 142) E/flutter ( 6159): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Null check operator used on a null value E/flutter ( 6159): #0 _HomeBodyState.build.

To recreate the issue you can download the original image file from here and try scanning using the scanImagePath method.

I also noticed that image scanning works fine if I optimize the image using an online optimizing tool like jpeg-optimizer.

Thank you.