code wiki / _hdl_build / nx_cms_image.nx

nx_cms_image.nx

buildroot/runtime/_hdl_build/nx_cms_image.nx

2599 B56 linesdepth 3pulls 3 transitivereach 1 importersview sourcekind librarytopic cms
docsdependenciesstructsconstsfunctions

about

nx_cms_image.nx -- CMS IMAGE OPTIMIZATION + CDN POLICY (sovereign). The Smush/Jetpack-CDN class, made Nishi-native: the pixel codec/resize is the only last-mile boundary; the OPTIMIZATION POLICY engine is sovereign and deterministic. It generates a responsive srcset from a fixed breakpoint ladder that NEVER upscales past the original, negotiates the best modern format the client accepts (AVIF > WebP > JPEG), and addresses every asset by a CONTENT HASH (via canonical nx_fnv) so the URL is immutable and changing the image AUTOMATICALLY busts the cache -- no manual purge, no stale-image bug (the exceed angle over a path-based cloud CDN). Images stay ON-BOX (privacy-native). Ladder = data-driven seam (rule 11). license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_fnv.nx nx_syscalls.nx nx_cms_image.nx nx_cms_image_gate.nx

imports: nx_fnv.nxnx_syscalls.nx

imported by: nx_cms_image_gate.nx

structs

none

consts

11const NX_MAGIC_1280: i64 = 1280
12const NX_MAGIC_1920: i64 = 1920
15const NX_IMG_JPEG: i64 = 0
16const NX_IMG_WEBP: i64 = 1
17const NX_IMG_AVIF: i64 = 2

functions

21func img_srcset_widths(orig_w: i64, out: *i64) -> i64
called by 1: main calls 1: sys_mmap
34func img_pick_format(accepts_avif: i64, accepts_webp: i64) -> i64
called by 1: main
42func img_cache_key(content: *u8, n: i64) -> i64
called by 1: main calls 1: fnv1a
47func img_scale_ok(orig_w: i64, target_w: i64) -> i64
called by 1: main
53func img_immutable(content_addressed: i64) -> i64
called by 1: main