code wiki / _hdl_build / nx_cms_image.nx
nx_cms_image.nx
buildroot/runtime/_hdl_build/nx_cms_image.nx
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
imports: nx_fnv.nxnx_syscalls.nx
imported by: nx_cms_image_gate.nx
structs
| none |
consts
| 11 | const NX_MAGIC_1280: i64 = 1280 |
| 12 | const NX_MAGIC_1920: i64 = 1920 |
| 15 | const NX_IMG_JPEG: i64 = 0 |
| 16 | const NX_IMG_WEBP: i64 = 1 |
| 17 | const NX_IMG_AVIF: i64 = 2 |
functions
| 21 | func img_srcset_widths(orig_w: i64, out: *i64) -> i64 |
| 34 | func img_pick_format(accepts_avif: i64, accepts_webp: i64) -> i64 called by 1: main |
| 42 | func img_cache_key(content: *u8, n: i64) -> i64 |
| 47 | func img_scale_ok(orig_w: i64, target_w: i64) -> i64 called by 1: main |
| 53 | func img_immutable(content_addressed: i64) -> i64 called by 1: main |