module

Vug::CrImageHelper

Shared helper for safely loading images via CrImage with comprehensive error handling. Extracted from ImageValidator and ImageDimensions to eliminate the duplicated with_crimage / with_crimage_result pattern.

Class methods

with_image(data : Bytes, default, & : CrImage::Image -> _)

Attempts to load raw bytes as a CrImage::Image and yields it. Returns default for empty data, nil reads, or any parse error.

Source