Skip to content

Fix/animated stickers#1322

Merged
DavidsonGomes merged 5 commits intoEvolutionAPI:developfrom
marceloapd:fix/animated-stickers
Mar 30, 2025
Merged

Fix/animated stickers#1322
DavidsonGomes merged 5 commits intoEvolutionAPI:developfrom
marceloapd:fix/animated-stickers

Conversation

@marceloapd
Copy link
Contributor

@marceloapd marceloapd commented Mar 20, 2025

WebP Animation Preservation Enhancement

Problem Statement

When sending .gif or animated .webp files as stickers, the animation is lost in the conversion process.

Solution

Modified the convertToWebP method to detect animated content and preserve animations during conversion using Sharp's animation support.

Technical Details

  • Added detection for animated GIFs and WebPs
  • Implemented Sharp's animated: true option for animation preservation
  • Added a helper method to inspect WebP headers for animation chunks

Benefits

  • Users can now send animated stickers properly
  • Maintains full backward compatibility with existing code
  • No changes to method signatures or calling code required

This enhancement addresses a specific functional gap without disrupting existing workflows.

Summary by Sourcery

Bug Fixes:

  • Fixes a bug where animations were lost when sending .gif or animated .webp files as stickers.

Loading
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

Successfully merging this pull request may close these issues.

2 participants