Skip to content

Commit 658dae0

Browse files
committed
lint fix
1 parent 027401b commit 658dae0

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2704,11 +2704,9 @@ export class BaileysStartupService extends ChannelStartupService {
27042704
}
27052705

27062706
const isAnimated = this.isAnimated(image, imageBuffer);
2707-
2707+
27082708
if (isAnimated) {
2709-
return await sharp(imageBuffer, { animated: true })
2710-
.webp({ quality: 80, animated: true })
2711-
.toBuffer();
2709+
return await sharp(imageBuffer, { animated: true }).webp({ quality: 80, animated: true }).toBuffer();
27122710
} else {
27132711
return await sharp(imageBuffer).webp().toBuffer();
27142712
}
@@ -2720,17 +2718,17 @@ export class BaileysStartupService extends ChannelStartupService {
27202718

27212719
private isAnimatedWebp(buffer: Buffer): boolean {
27222720
if (buffer.length < 12) return false;
2723-
2721+
27242722
return buffer.indexOf(Buffer.from('ANIM')) !== -1;
27252723
}
27262724

27272725
private isAnimated(image: string, buffer: Buffer): boolean {
27282726
const lowerCaseImage = image.toLowerCase();
2729-
2727+
27302728
if (lowerCaseImage.includes('.gif')) return true;
2731-
2729+
27322730
if (lowerCaseImage.includes('.webp')) return this.isAnimatedWebp(buffer);
2733-
2731+
27342732
return false;
27352733
}
27362734

0 commit comments

Comments
 (0)