Skip to content

decode.Function.extractISO

github-actions[bot] edited this page Oct 18, 2026 · 2 revisions

@monogrid/gainmap-js / decode / extractISO

Function: extractISO()

extractISO(input): GainMapMetadata | undefined

Defined in: src/decode/shared/utils/extractISO.ts:19

Extracts ISO 21496-1 gain map metadata from a JPEG file

Looks for APP2 segments carrying the ISO 21496-1 namespace, skipping the version-only segment stored in the primary image.

0xFF 0xE2 cannot appear inside entropy-coded data, so a byte scan is safe.

Parameters

input

Uint8Array

an Uint8Array containing an encoded JPEG file

Returns

GainMapMetadata | undefined

the parsed metadata or undefined if no supported ISO 21496-1 metadata is found

Clone this wiki locally