@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