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

Function createUltraCompressedJPEG

src/utils/imageResizer.ts:745–762  ·  view source on GitHub ↗
(
  context: ImageCompressionContext,
  sharp: SharpFunction,
)

Source from the content-addressed store, hash-verified

743}
744
745async function createUltraCompressedJPEG(
746 context: ImageCompressionContext,
747 sharp: SharpFunction,
748): Promise<CompressedImageResult> {
749 const ultraCompressedBuffer = await sharp(context.imageBuffer)
750 .resize(400, 400, {
751 fit: 'inside',
752 withoutEnlargement: true,
753 })
754 .jpeg({ quality: 20 })
755 .toBuffer()
756
757 return createCompressedImageResult(
758 ultraCompressedBuffer,
759 'jpeg',
760 context.originalSize,
761 )
762}
763
764/**
765 * Detect image format from a buffer using magic bytes

Callers 1

compressImageBufferFunction · 0.85

Calls 2

resizeMethod · 0.45

Tested by

no test coverage detected