Skip to content

@mega-yfue/eufy-sdk / decodeImageV2

Function: decodeImageV2() ​

ts
function decodeImageV2(data): Buffer<ArrayBufferLike> | null;

Decode a v2 blob to a plain JPEG buffer by reconstructing its header, or null if it isn't v2, the plaintext scan can't be located, or no frame shape explains it.

Three steps and no pixel rewrite: the frame shape is read out of the entropy scan, one probe decode both proves the spliced JPEG decodes and measures how far the substitute quant tables fall short of the camera's, and the answer is the same tail under a header carrying the corrected tables. See the module doc for the keyless-splice rationale and for why neither the search nor the correction decodes candidate frames or re-encodes the picture.

Parameters ​

data ​

Buffer

Returns ​

Buffer<ArrayBufferLike> | null

Independent and unofficial. Not affiliated with, endorsed by, or sponsored by Anker Innovations, Anker eufy, or eufy. "Anker eufy", "eufy" and "Anker" are trademarks of their respective owners. Use responsibly — rapid or failed logins can trigger captcha or temporary cooldowns.