diff --git a/lib/qoix.ex b/lib/qoix.ex index a61b7dd..7e18653 100644 --- a/lib/qoix.ex +++ b/lib/qoix.ex @@ -3,13 +3,12 @@ defmodule Qoix do Qoix is an Elixir implementation of the [Quite OK Image](https://phoboslab.org/log/2021/11/qoi-fast-lossless-image-compression) format. """ - @header_size 12 @doc """ Returns true if the binary appears to contain a valid QOI image. """ - def qoi?(<<"qoif", _width::size(16), _height::size(16), size::size(32), _::binary>> = binary) - when byte_size(binary) >= @header_size + size do + def qoi?(<<"qoif", _width::32, _height::32, channels::8, _colorspace::8, _rest::binary>>) + when channels == 3 or channels == 4 do true end