Skip to content

Function: parseJpegSize() ​

ts
function parseJpegSize(bytes): ImageSize;

Reads a JPEG's pixel dimensions from its start-of-frame marker. Pure and dependency-free: it walks the segment markers without decoding the image.

Parameters ​

ParameterType
bytesUint8Array

Returns ​

ImageSize

MIT License. Not affiliated with, endorsed or sponsored by Meta or Instagram.