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

Gif size #664

Closed
mbfakourii opened this issue Jul 10, 2024 · 2 comments
Closed

Gif size #664

mbfakourii opened this issue Jul 10, 2024 · 2 comments

Comments

@mbfakourii
Copy link

By default, the size of the gift is created based on the first frame in encodeGif. How can it be set to create based on the largest frame?

@brendan-duncan
Copy link
Owner

I'll have to add that feature, but it will probably take some time before I can get to it. You could iterate through the frames, find the largest, then for each frame smaller, replace the frame with copyExpandCanvas. Sorry I can't give example code right now, typing from my phone.

@mbfakourii
Copy link
Author

mbfakourii commented Jul 11, 2024

Thanks, the problem is solved. ❤️❤️

copyExpandCanvas(
  decodedImage,
  newWidth: width,
  newHeight: height,
  toImage: Image(
    width: width,
    height: height,
    format: decodedImage.format,
    numChannels: 4,
  ),
),

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