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

Function createCompressedImageResult

src/utils/imageResizer.ts:632–644  ·  view source on GitHub ↗
(
  buffer: Buffer,
  mediaType: string,
  originalSize: number,
)

Source from the content-addressed store, hash-verified

630// Helper functions for compression pipeline
631
632function createCompressedImageResult(
633 buffer: Buffer,
634 mediaType: string,
635 originalSize: number,
636): CompressedImageResult {
637 const normalizedMediaType = mediaType === 'jpg' ? 'jpeg' : mediaType
638 return {
639 base64: buffer.toString('base64'),
640 mediaType:
641 `image/${normalizedMediaType}` as Base64ImageSource['media_type'],
642 originalSize,
643 }
644}
645
646async function tryProgressiveResizing(
647 context: ImageCompressionContext,

Callers 5

compressImageBufferFunction · 0.85
tryProgressiveResizingFunction · 0.85
tryPalettePNGFunction · 0.85
tryJPEGConversionFunction · 0.85

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected