export type ImageFormat = 'png' | 'jpeg' | 'webp' | 'gif' | 'avif' | 'unknown';
export interface SniffResult {
format: ImageFormat;
mime: string;
ext: string;
}
/**
* Inspect the leading bytes of `buf` and return the image format. Returns
* `{ format: 'unknown', mime: 'application/octet-stream', ext: '.bin' }` when
* no known magic matches.
*/
export declare function sniffImageFormat(buf: Uint8Array | Buffer): SniffResult;
/**
* Write image bytes to disk, using the sniffed extension instead of the
* caller-supplied extension when they disagree.
*
* Returns the final on-disk path. When `requestedPath` says `.png` but the
* buffer is actually WebP, the true-format bytes are written as
* `.webp` AND the file is transcoded to the requested `.png` via
* ffmpeg — because the reference-path resolvers (`reference-slots.ts`,
* `panel-fixer.ts`, the storyboard refiner) all resolve fixed `.png` names
* and silently lose the asset otherwise (the 2026-08-10 montage E2E failure:
* every character-refine pass errored with "Reference image not found:
* …/front.png" while `front.webp` sat next to it). If ffmpeg is missing or
* the transcode fails, we fall back to the old behavior (sniffed-ext file
* only, with a louder warning). Pass `forceExt: true` to keep the caller's
* extension without any transcode (the format on disk will be a lie).
*/
export declare function writeImageBytesSmart(buf: Buffer, requestedPath: string, opts?: {
forceExt?: boolean;
}): Promise;
//# sourceMappingURL=image-bytes.d.ts.map