nx_img_dims.nx
buildroot/runtime/nx_img_dims.nx
about
nx_img_dims.nx -- read an image's pixel WIDTH/HEIGHT straight from its header bytes (no decode). Powers the
media importer's junk filter: reject nav icons / spacer gifs / 1x1 tracking pixels by their REAL dimensions
(URL heuristics lie; header bytes don't). Handles PNG (IHDR), GIF (screen descriptor), JPEG (SOF marker walk),
and WEBP (VP8X extended / VP8 lossy / VP8L lossless). Unknown/short -> returns 0 (caller decides: we KEEP on
unknown so a novel format is never silently dropped). Integer-only, deterministic. license_tier: INDEPENDENT_REDERIVE
dependencies 1 imports · 6 importers
imports: nx_syscalls.nx
imported by: nx_img_dims_gate.nxnx_kkfacts_lib.nxnx_manga_get.nxnx_media_usable.nxnx_mediafacts_lib.nxnx_reader_tile.nx
structs
| none |
consts
| none |
functions
| 8 | func _be16(b: *u8, o: i64) -> i64 { return ((b[o] as i64 & 0xff) << 8) | (b[o+1] as i64 & 0xff) } called by 1: nx_img_dims |
| 9 | func _be32(b: *u8, o: i64) -> i64 { return ((b[o] as i64 & 0xff) << 24) | ((b[o+1] as i64 & 0xff) << 16) | ((b[o+2] as i64 & 0xff) << 8) | (b[o+3] as i64 & 0xff) } called by 1: nx_img_dims |
| 10 | func _le16(b: *u8, o: i64) -> i64 { return (b[o] as i64 & 0xff) | ((b[o+1] as i64 & 0xff) << 8) } called by 1: nx_img_dims |
| 11 | func _le24(b: *u8, o: i64) -> i64 { return (b[o] as i64 & 0xff) | ((b[o+1] as i64 & 0xff) << 8) | ((b[o+2] as i64 & 0xff) << 16) } called by 1: nx_img_dims |
| 14 | func nx_img_dims(buf: *u8, n: i64, wh: *i64) -> i64 called by 6: nx_img_long_edgemainkk_probemu_check_bookmf_probert_raw_manifest calls 5: _be32_le16_le24_le32b_be16 |
| 75 | func _le32b(b: *u8, o: i64) -> i64 { return (b[o] as i64 & 0xff) | ((b[o+1] as i64 & 0xff) << 8) | ((b[o+2] as i64 & 0xff) << 16) | ((b[o+3] as i64 & 0xff) << 24) } called by 1: nx_img_dims |
| 78 | func nx_img_long_edge(buf: *u8, n: i64) -> i64 |