Reads JPEG metadata without decoding image pixels.
The JPEG binary can be embedded directly in the PDF using
/DCTDecode.
Summary
Functions
Returns whether a binary begins with the JPEG start-of-image marker.
Reads JPEG metadata.
Reads JPEG metadata and raises when the binary is invalid.
Types
@type color_space() :: :device_gray | :device_rgb | :device_cmyk
@type error_reason() :: :invalid_jpeg | :missing_start_of_frame | :truncated_marker | :truncated_segment | :invalid_segment_length | :invalid_start_of_frame | {:unsupported_components, non_neg_integer()}
@type metadata() :: %{ width: pos_integer(), height: pos_integer(), bits_per_component: pos_integer(), components: pos_integer(), color_space: color_space() }
Functions
Returns whether a binary begins with the JPEG start-of-image marker.
@spec parse(binary()) :: {:ok, metadata()} | {:error, error_reason()}
Reads JPEG metadata.
Reads JPEG metadata and raises when the binary is invalid.