format_parser v0.9.0 FormatParser
The Format Parser
Link to this section Summary
Functions
Parses the format of a given file. Or returs an error if unknown
Link to this section Functions
Parses the format of a given file. Or returs an error if unknown.
Examples
iex> {:ok, file} = File.read("priv/test.jpg")
iex> FormatParser.parse(file)
%FormatParser.Image{format: :jpg, height_px: nil, nature: :image, width_px: nil}
iex> {:ok, file} = File.read("priv/test.html")
iex> FormatParser.parse(file)
{:error, "Unknown"}