File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/api/integrations/channel/whatsapp Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -2351,7 +2351,7 @@ export class BaileysStartupService extends ChannelStartupService {
23512351 const isAnimated = this . isAnimated ( image , imageBuffer ) ;
23522352
23532353 if ( isAnimated ) {
2354- return await sharp ( imageBuffer , { animated : true } ) . webp ( { quality : 80 , animated : true } ) . toBuffer ( ) ;
2354+ return await sharp ( imageBuffer , { animated : true } ) . webp ( { quality : 80 } ) . toBuffer ( ) ;
23552355 } else {
23562356 return await sharp ( imageBuffer ) . webp ( ) . toBuffer ( ) ;
23572357 }
@@ -2368,9 +2368,11 @@ export class BaileysStartupService extends ChannelStartupService {
23682368 }
23692369
23702370 private isAnimated ( image : string , buffer : Buffer ) : boolean {
2371- if ( image . includes ( '.gif' ) ) return true ;
2371+ const lowerCaseImage = image . toLowerCase ( ) ;
23722372
2373- if ( image . includes ( '.webp' ) ) return this . isAnimatedWebp ( buffer ) ;
2373+ if ( lowerCaseImage . includes ( '.gif' ) ) return true ;
2374+
2375+ if ( lowerCaseImage . includes ( '.webp' ) ) return this . isAnimatedWebp ( buffer ) ;
23742376 return false ;
23752377 }
23762378
You can’t perform that action at this time.
0 commit comments