Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range Error inside decoded image #607

Closed
Sarathlal13 opened this issue Jan 17, 2024 · 13 comments
Closed

Range Error inside decoded image #607

Sarathlal13 opened this issue Jan 17, 2024 · 13 comments

Comments

@Sarathlal13
Copy link

I was trying to decode a uint8List using decodeImage method. when debug, seems an error inside the decoded Image. it affects the further processes with the image file. issue found after updating version from 3.3.0 to 4.1.3
Screenshot 2024-01-17 at 11 53 52

@Sarathlal13
Copy link
Author

Flutter doctor

[✓] Flutter (Channel stable, 3.13.4, on macOS 14.0 23A344 darwin-x64, locale en-GB)
• Flutter version 3.13.4 on channel stable at /Users/mac/Documents/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 367f9ea16b (4 months ago), 2023-09-12 23:27:53 -0500
• Engine revision 9064459a8b
• Dart version 3.1.2
• DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/mac/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15A507
• CocoaPods version 1.13.0

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.85.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.80.0

[✓] Connected device (4 available)
• SM T220 (mobile) • adb-R9PT904MHKL-r2sRrU._adb-tls-connect._tcp. • android-arm64 • Android 13 (API 33)
• iya’s iPad (mobile) • 00008101-000204AC3C29001E • ios • iOS 17.1.2 21B101
• macOS (desktop) • macos • darwin-x64 • macOS 14.0 23A344 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.216

[✓] Network resources
• All expected network resources are available.

• No issues found!

@brendan-duncan
Copy link
Owner

Sorry, there isn't nearly enough info here for me to diagnose the issue. If you have something I can reproduce, I can help.

@Sarathlal13
Copy link
Author

thank you, is there any known issue when converting a unit8List file to Image file, with decodeImage(_)...

what I was trying to do is

final img.Image? decodedImage = img.decodeImage(uint8ListImage!);

getting result but showing RangeError inside iterator

@brendan-duncan
Copy link
Owner

brendan-duncan commented Jan 20, 2024

What does the Uint8List contain? An image file? What format?

@Sarathlal13
Copy link
Author

Uint8List contains image file of PNG format

@brendan-duncan
Copy link
Owner

Any way you can send me the contents of that buffer?

@Sarathlal13
Copy link
Author

sure, thank you. Please check attached file

uint8Image.txt

@Sarathlal13
Copy link
Author

Hello,

I'm sorry to bother you, but do you have any updates on this issue? I am still unable to update this package for my project.

Thank you.

@brendan-duncan
Copy link
Owner

Sorry I got busy and forgot to get back to this. I'll take a look as soon as I can.

@brendan-duncan
Copy link
Owner

I apologize for forgetting to look into this earlier. I tested the data from the file you attached, and unfortunately (or fortunately?) I didn't have any issues loading or saving it.

My test was

const data = [....]; // from the uint8Image.txt file
final bytes = Uint8List.fromList(data);
final image = decodeImage(bytes);
encodePngFile("d:/test.png", image!);

which resulted in:
test

@Sarathlal13
Copy link
Author

Hello sir,

Displaying image is perfectly work with me. did you find any error inside iterator field? just to confirm if its a issue with my input

@brendan-duncan
Copy link
Owner

I did not find any errors.

@Sarathlal13
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants