mjafartp / flutter_esc_pos_utils

Flutter package of esc/pos utils
GNU General Public License v3.0
21 stars 46 forks source link

RangeError: Invalid value: Not in inclusive range when calling imageRaster #39

Open YellowTreeGood opened 5 months ago

YellowTreeGood commented 5 months ago

Hello,

d.zip

With some images, calling imageRaster causes a RangeError. I have attached an image that causes such error. The following is the stack trace of the error.

RangeError: Invalid value: Not in inclusive range 0..5669: 5826 ...

0 List.insertAll (dart:core-patch/growable_array.dart:44:7)

  #1      Generator._toRasterFormat (package:flutter_esc_pos_utils/src/generator.dart:189:25)
  #2      Generator.imageRaster (package:flutter_esc_pos_utils/src/generator.dart:656:38)
  #3      F_BluetoothDevice.print (package:fmc_bms/fmc.dart:180:33) <asynchronous suspension>
  #4      _F_PrintDialogueState.build.<anonymous closure>.<anonymous closure> (package:fmc_bms/common/ui/PrintingWidgets.dart:266:85) <asynchronous suspension>

Please have a look. Thank you.

YellowTreeGood commented 5 months ago

The error only occurs for images whose width in pixels are not divisible by 8