Png.png.valid: def of gralha-png-decode@0.1.0.1 Import: import gralha-png-decode@0.1.0.1/png.bend as Png Lines 54-56 of gralha-png-decode@0.1.0.1/png.bend: https://jend.leeeet.dev/read.txt?path=gralha-png-decode@0.1.0.1/png.bend&start_line=54&end_line=56 import Base import gralha-bytes@0.1.0.1/bytes.bend as Bin def png.valid(+info: PNGInfo) -> Bool: PNGInfo{w, h, depth, kind, interlace, palette, alpha, compressed, valid} = info valid && U32.is_gt(w, 0) && U32.is_gt(h, 0) && U32.is_le(w, 2048) && U32.is_le(h, 2048) && png.depth.valid(kind, depth) && U32.is_le(interlace, 1) && (Bool.not(U32.is_eq(kind, 3)) || (U32.is_gt(Bin.bytes.size(palette), 0) && U32.is_eq(U32.mod(Bin.bytes.size(palette), 3), 0) && U32.is_le(Bin.bytes.size(palette), 768))) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_gt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mod https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.size https://jend.leeeet.dev/definition.txt?path=gralha-png-decode@0.1.0.1/png.bend&name=PNGInfo https://jend.leeeet.dev/definition.txt?path=gralha-png-decode@0.1.0.1/png.bend&name=png.depth.valid