PrawnEx.Image.JPEG (prawn_ex v0.5.0)

Copy Markdown View Source

Loads JPEG for PDF embedding. Reads dimensions from SOF0/SOF2 and returns raw JPEG bytes (embedded as /DCTDecode stream).

Summary

Functions

Loads JPEG from path (string) or raw binary. Returns {:ok, %{data: binary, width: w, height: h}} or {:error, reason}. Data is the full JPEG bytes (embedded as-is with /DCTDecode).

Functions

load(data)

@spec load(String.t() | binary()) :: {:ok, map()} | {:error, term()}

Loads JPEG from path (string) or raw binary. Returns {:ok, %{data: binary, width: w, height: h}} or {:error, reason}. Data is the full JPEG bytes (embedded as-is with /DCTDecode).