class

CrImage::DecompressionGuard::Guard

Inherits Reference / Object

Guard tracks decompression progress and enforces limits

Constructors

new(format : String, config : Config = DecompressionGuard.default_config)
Source

Instance methods

add_compressed(bytes : Int) : Nil

Record compressed data read

Source
add_decompressed(bytes : Int) : Nil

Record decompressed data produced

Source
check_limits

Check if limits are exceeded and raise if so

Source
stats

Get current statistics

Source
validate_expected_size(width : Int32, height : Int32, bytes_per_pixel : Int32) : Nil

Validate expected decompressed size against limits Call this when you know the expected size before decompression

Source