class
Crowbar::Rules::PNGRule
- Crowbar::Rules::PNGRule
- Crowbar::Rule
- Reference
- Object
Overview
Structure-preserving rule for Portable Network Graphics (PNG) images. Preserves the 8-byte PNG file signature and valid chunk framing (IHDR, IDAT, IEND, and auxiliary chunks), while mutating header dimensions, bit depths, color types, scanline payloads, or chunk tags, and automatically recalculating 4-byte chunk lengths and CRC32 checksums.
Defined in:
crowbar/rules/png.crConstant Summary
-
PNG_SIGNATURE =
Bytes[137, 80, 78, 71, 13, 10, 26, 10]
Instance Method Summary
-
#apply(context : Context, buffer : Buffer) : Bool
Applies a structure-preserving transformation to the buffer
- #description : String
-
#match?(buffer : Buffer) : Bool
Checks whether the buffer matches the format handled by this rule
- #name : String
-
#parse_chunks(buffer : Buffer) : Array(Chunk)
Parses all valid PNG chunks from the buffer
Instance methods inherited from class Crowbar::Rule
apply(context : Context, buffer : Buffer) : Bool
apply,
description : String
description,
match?(buffer : Buffer) : Bool
match?,
name : String
name,
targets(*targets : Symbol)
targets,
weight : Float64
weight,
weight=(weight : Float64)
weight=
Constructor methods inherited from class Crowbar::Rule
new(weight : Float64 = 1.0)
new
Instance Method Detail
Description copied from class Crowbar::Rule
Applies a structure-preserving transformation to the buffer
Description copied from class Crowbar::Rule
Checks whether the buffer matches the format handled by this rule