Hwaro::Content::Processors::ImageProcessor
Constants
Only formats that stb can both read AND write back correctly.
Maximum pixel count to prevent excessive memory allocation (64 megapixels)
Instance methods
Compute dominant color as a hex string (e.g., "#a3b2c1"). Channels: 1=gray, 2=gray+alpha, 3=RGB, 4=RGBA
Generate a low-quality image placeholder as a base64 data URI. Operates on already-decoded pixel data (avoids a second stbi_load).
Generate LQIP data URI and dominant color from the thumbnail in one pass. Returns {data_uri, dominant_color_hex} or nil on failure.
Process all images for configured widths. Returns array of {original_url, width, resized_url} tuples.
Resize a single image to the given width, preserving aspect ratio. Returns the output path on success, nil on failure.
Combined resize + LQIP in a single decode pass. Returns {width_map, lqip_data_uri_or_nil, dominant_color_hex}
Resize a single source image to multiple widths with one decode pass. Returns a Hash mapping width => dest_path for successful resizes.
Generate a resized filename: photo.jpg -> photo_800w.jpg