MCPcopy Index your code
hub / github.com/codeaashu/claude-code / applyFormatOptimizations

Function applyFormatOptimizations

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

Source from the content-addressed store, hash-verified

680}
681
682function applyFormatOptimizations(
683 image: SharpInstance,
684 format: string,
685): SharpInstance {
686 switch (format) {
687 case 'png':
688 return image.png({
689 compressionLevel: 9,
690 palette: true,
691 })
692 case 'jpeg':
693 case 'jpg':
694 return image.jpeg({ quality: 80 })
695 case 'webp':
696 return image.webp({ quality: 80 })
697 default:
698 return image
699 }
700}
701
702async function tryPalettePNG(
703 context: ImageCompressionContext,

Callers 1

tryProgressiveResizingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected