Skip to main content

Module sniff

Module sniff 

Source
Expand description

Sniffs containers for animation.

A picture names its own format in its first bytes and carries its frame sequence, if it has one, at a place each format fixes. Reading those is what lets a request for a still be honored against a file whose declared content type says otherwise, or says nothing useful, as image/png does for an APNG.

A walk answers one of three states, because the two questions asked of it take opposite defaults. Whether a picture may be served fails closed, so an unreadable one is withheld and a wrong answer costs a needless re-encode rather than a violation; what a picture is names nothing the walk did not settle, since a guess there would be written down as fact.

EnumsΒ§

Sequence πŸ”’
What a container’s header settles about a frame sequence.

ConstantsΒ§

GIF_COLOR_TABLE πŸ”’
GIF_EXTENSION πŸ”’
GIF_HEADER_LEN πŸ”’
Bytes the signature and the logical screen descriptor occupy together.
GIF_IMAGE πŸ”’
GIF_MAGIC πŸ”’
GIF_TABLE_SIZE πŸ”’
GIF_TRAILER πŸ”’
PNG_ANIMATION πŸ”’
PNG_DATA πŸ”’
PNG_MAGIC πŸ”’
RIFF_MAGIC πŸ”’
WEBP_ANIMATION πŸ”’
WEBP_EXTENDED πŸ”’
WEBP_LOSSLESS πŸ”’
WEBP_LOSSY πŸ”’
WEBP_MAGIC πŸ”’

FunctionsΒ§

animated_type πŸ”’
The container type a picture’s own bytes name.
animates πŸ”’
Whether these bytes may carry more than one frame.
color_table_len πŸ”’
Size in bytes of the colour table a descriptor announces.
gif_sequence πŸ”’
Whether a GIF holds more than one image descriptor.
image_data_start πŸ”’
Offset of an image descriptor’s sub-block chain.
png_sequence πŸ”’
Whether a PNG holds the control chunk that makes it an APNG.
sequence πŸ”’
Walks the container its first bytes name.
skip_sub_blocks πŸ”’
Offset past the sub-block chain starting here, when it ends.
webp_sequence πŸ”’
Whether a WebP announces animation in its opening chunk.