code wiki / (root) / nx_img_dims.nx

nx_img_dims.nx

buildroot/runtime/nx_img_dims.nx

5268 B85 linesdepth 2pulls 2 transitivereach 19 importersview sourcekind librarytopic img
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_img_dims.nx nx_img_dims_gate.nx nx_kkfacts_lib.nx nx_manga_get.nx nx_media_usable.nx nx_mediafacts_lib.nx nx_reader_tile.nx

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

8func _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
9func _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
10func _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
11func _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
14func nx_img_dims(buf: *u8, n: i64, wh: *i64) -> i64
75func _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
78func nx_img_long_edge(buf: *u8, n: i64) -> i64