-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fix/animated stickers #1322
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
Fix/animated stickers #1322
Conversation
Reviewer's Guide by SourceryThis pull request modifies the Sequence diagram for animated WebP conversionsequenceDiagram
participant A as BaileysStartupService
participant S as sharp
A->>A: isAnimated(image, imageBuffer)
alt isAnimated == true
A->>S: sharp(imageBuffer, { animated: true })
S->>S: webp({ quality: 80, animated: true })
S-->>A: webpBuffer
else isAnimated == false
A->>S: sharp(imageBuffer)
S->>S: webp()
S-->>A: webpBuffer
end
A-->>A: return webpBuffer
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @marceloapd - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider extracting the logic for converting to a static WebP into a separate function for better readability.
- The
isAnimated
function could be simplified by extracting the file extension check into a separate helper.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts
Outdated
Show resolved
Hide resolved
Ajuste o lint por favor, estava para a branch |
Feito |
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
animated: true
option for animation preservationBenefits
This enhancement addresses a specific functional gap without disrupting existing workflows.
Summary by Sourcery
Bug Fixes: