feat(image): convert HEIC paste uploads to JPEG

When a browser pastes an HEIC file without normalising it first, the
paste-image route now converts it to JPEG server-side via heic-convert
before writing to .claude-images/. Magic-byte validation confirms the
output is valid JPEG. Adds type declarations for the heic-convert package.

Co-authored-by: Saqeb Akhter <saqeb.akhter@gmail.com>
This commit is contained in:
Aamer Akhter
2026-07-11 16:32:49 -04:00
co-authored by Saqeb Akhter
parent 1fa88cd187
commit bb1d16e230
5 changed files with 151 additions and 2 deletions
+9
View File
@@ -0,0 +1,9 @@
declare module 'heic-convert' {
export interface ConvertOptions {
buffer: Buffer;
format: 'JPEG' | 'PNG';
quality?: number;
}
export default function convert(options: ConvertOptions): Promise<Buffer | Uint8Array | ArrayBuffer>;
}