You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi thank you for this package. I need a little help using the GifDecoder and GifEncoder 🙏
ByteData bytes = await rootBundle.load(asset);
// Decode the bytes to [Image] type
final gifInfo = img.GifDecoder().startDecode(bytes.buffer.asUint8List());
final encoder = img.GifEncoder();
for (int i = 0; i < gifInfo!.numFrames; i++) {
final image =
img.GifDecoder().decode(bytes.buffer.asUint8List(), frame: i);
encoder.addFrame(image!);
}
final result = encoder.finish()!;
I want to manipualte some pixels later but for now I cannot even decode then encode the same gif.When I check the gif info I can see all the frames however when I display this in flutter or from outside of the app it only shows first frame and throws
[ERROR:flutter/lib/ui/painting/multi_frame_codec.cc(109)] Could not getPixels for frame 1
════════ Exception caught by image resource service ════════════════════════════
The following _Exception was thrown resolving an image frame:
Exception: Could not getPixels for frame 1
I tried to not pass frame to decode function aswell but same output.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi thank you for this package. I need a little help using the GifDecoder and GifEncoder 🙏
I want to manipualte some pixels later but for now I cannot even decode then encode the same gif.When I check the gif info I can see all the frames however when I display this in flutter or from outside of the app it only shows first frame and throws
I tried to not pass frame to
decode
function aswell but same output.Any help is appreciated I'm so lost
Beta Was this translation helpful? Give feedback.
All reactions