• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hicommonwealth / commonwealth / 12817593965

16 Jan 2025 09:06PM UTC coverage: 47.698% (-0.03%) from 47.726%
12817593965

push

github

web-flow
Merge pull request #10408 from hicommonwealth/devin/1734649172-add-image-compression

fix: add image compression for DALL-E generated images

1350 of 3171 branches covered (42.57%)

Branch coverage included in aggregate %.

0 of 5 new or added lines in 2 files covered. (0.0%)

1 existing line in 1 file now uncovered.

2680 of 5278 relevant lines covered (50.78%)

36.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/libs/model/src/utils/imageCompression.ts
1
import sharp from 'sharp';
2

3
export async function compressServerImage(buffer: Buffer): Promise<Buffer> {
NEW
4
  try {
×
NEW
5
    return await sharp(buffer)
×
6
      .resize(1000, 1000, {
7
        fit: 'inside',
8
        withoutEnlargement: true,
9
      })
10
      .jpeg({
11
        quality: 80,
12
        progressive: true,
13
      })
14
      .toBuffer();
15
  } catch (e) {
NEW
16
    console.error('Image compression failed:', e);
×
NEW
17
    throw e;
×
18
  }
19
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc