image
image copied to clipboard
ImageException (ImageException: TIFFFaxDecoder5 10)
Hi , I'm getting error "ImageException (ImageException: TIFFFaxDecoder5 10)" ; I can not understand ,why I get that error.I can open that base 64 data on IE Browser
import 'package:image/image.dart' as img; ...
final img.TiffDecoder decoder = img.TiffDecoder(); decoder.startDecode(base64Decode(content)); final List<TiffPage> tiffPages = <TiffPage>[];
for (int i = 0; i < decoder.info.numFrames; i++) {
Uint8List base64 = base64Decode(content);
// **I'm getting error below row**
final img.Image image = decoder.decodeImage(base64, frame: i);
...
}
I 'm using 2.1.19 image [✓] Flutter (Channel stable, 1.22.6, on macOS 11.6 20G165 darwin-x64, locale en-GB) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 12.5.1) [✓] Android Studio (version 3.6) Dart SDK version: 2.10.5 (stable) (Tue Jan 19 13:05:37 2021 +0100) on "macos_x64"
Thanks
I don't know why you're getting that error exactly, it comes from a invalid value while reading the TIFF Fax format.
You probably don't want to decode the base64 every frame. You can clean up your decoding code with something like:
var decoder = img.TiffDecoder()
decoder.startDecode(base64Decode(content));
final tiffPages = [];
for (var i = 0; i < decoder.numFrames(); ++i) {
final image = decoder.decodeFrame(i);
....
}
we changed it as you said,nothing has changed. We can open the data on browser . How can we find invalid value on data ?
If you include a test image that has the issue, I can look into it. Tiff is a complex format, lots of variations.