MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / applyFormatOptimizations

Function applyFormatOptimizations

src/utils/imageResizer.ts:697–715  ·  view source on GitHub ↗
(
  image: SharpInstance,
  format: string,
)

Source from the content-addressed store, hash-verified

695}
696
697function applyFormatOptimizations(
698 image: SharpInstance,
699 format: string,
700): SharpInstance {
701 switch (format) {
702 case 'png':
703 return image.png({
704 compressionLevel: 9,
705 palette: true,
706 })
707 case 'jpeg':
708 case 'jpg':
709 return image.jpeg({ quality: 80 })
710 case 'webp':
711 return image.webp({ quality: 80 })
712 default:
713 return image
714 }
715}
716
717async function tryPalettePNG(
718 context: ImageCompressionContext,

Callers 1

tryProgressiveResizingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected