[][src]Crate mimesniff

Constants

SNIFF_LENGTH

Functions

detect_content_type

detect_content_type implements the algorithm described at https://mimesniff.spec.whatwg.org/ to determine the Content-Type of the given data. It considers at most the first 512 bytes of data. detect_content_type always returns a valid MIME type: if it cannot determine a more specific one, it returns "application/octet-stream". It currently supports only JPEG and PNG.

is_jpeg

Returns whether a buffer is JPEG image data.

is_png

Returns whether a buffer is PNG image data.