Decodes PNG, baseline/progressive JPEG, the first GIF frame, and BMP on the BEAM.
No third-party NIFs, executables, network requests or runtime dependencies.
Standard OTP :zlib decompresses PNG data. Output is eight-bit RGBA.
Summary
Functions
Decodes encoded bytes into {:ok, image} or {:error, %Rasterling.Error{}}.
Like decode/2, but raises Rasterling.Error on failure.
Reads at most :max_bytes + 1 bytes from a local file, then decodes them.
Functions
@spec decode(binary(), keyword()) :: {:ok, Rasterling.Image.t()} | {:error, Rasterling.Error.t()}
Decodes encoded bytes into {:ok, image} or {:error, %Rasterling.Error{}}.
Options: :max_bytes, :max_pixels, :timeout (milliseconds) and
:max_memory_bytes (worker heap budget). All must be positive integers.
The GC-checked worker budget includes shared reference-counted binaries.
It is not a process RSS or VM-wide memory guarantee.
Like decode/2, but raises Rasterling.Error on failure.
Reads at most :max_bytes + 1 bytes from a local file, then decodes them.