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

Function applyFormatOptimizations

source code/utils/imageResizer.ts:684–702  ·  view source on GitHub ↗
(
  image: SharpInstance,
  format: string,
)

Source from the content-addressed store, hash-verified

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

Callers 1

tryProgressiveResizingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected