Skip to content

error while exporting gif #46

@bhatakeed

Description

@bhatakeed

Is there an existing issue for this?

  • I have searched the existing issues

Package/Plugin version

0.3.0

Platforms

  • Android
  • iOS
  • Linux
  • MacOS
  • Web
  • Windows

Flutter doctor

[✓] Flutter (Channel stable, 3.24.0, on macOS 14.5 23F79 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] Android Studio (version 2023.2)
[✓] VS Code (version 1.92.2)
[✓] Connected device (5 available)
[✓] Network resources

• No issues found!

Minimal code example

var gif = await controller.exporter.exportGif();
if (gif == null) {
throw Exception();
}

Current Behavior

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: RangeError (length): Invalid value: Not in inclusive range 0..255: 65423
#0 Int32List.[] (dart:typed_data-patch/typed_data_patch.dart)
#1 NeuralQuantizer._inxSearch (package:image/src/util/neural_quantizer.dart:141:22)
#2 NeuralQuantizer.getColorIndex (package:image/src/util/neural_quantizer.dart:68:12)
#3 Quantizer.getIndexImage (package:image/src/util/quantizer.dart:36:14)
#4 ditherImage (package:image/src/filter/dither_image.dart:69:22)
#5 quantize (package:image/src/filter/quantize.dart:26:10)
#6 Exporter._encodeGifWIthTransparency (package:screen_recorder/src/exporter.dart:109:28)
#7 Exporter._exportGif (package:screen_recorder/src/exporter.dart:79:9)

Expected Behavior

it should generate the gif like in android

Steps To Reproduce

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: RangeError (length): Invalid value: Not in inclusive range 0..255: 65423
#0 Int32List.[] (dart:typed_data-patch/typed_data_patch.dart)
#1 NeuralQuantizer._inxSearch (package:image/src/util/neural_quantizer.dart:141:22)
#2 NeuralQuantizer.getColorIndex (package:image/src/util/neural_quantizer.dart:68:12)
#3 Quantizer.getIndexImage (package:image/src/util/quantizer.dart:36:14)
#4 ditherImage (package:image/src/filter/dither_image.dart:69:22)
#5 quantize (package:image/src/filter/quantize.dart:26:10)
#6 Exporter._encodeGifWIthTransparency (package:screen_recorder/src/exporter.dart:109:28)
#7 Exporter._exportGif (package:screen_recorder/src/exporter.dart:79:9)

Aditional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions