Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For other platforms it should check to see if it's more efficient to serve a JPEGXL WASM polyfill


Writing a good polyfill for this is harder than you might think, because the browser by default does lazy decoding of JPEG images to avoid holding too many buffers in RAM. Naive attempts (niutech/jxl.js) at JXL polyfills tend to crash browser tabs by using too much memory if they contain a few dozen megapixels of images, while Chrome normally can handle hundreds of megapixels of JPEGs on a page without difficulty.


Relying on a polyfill means the browsers preloader won’t fetch the image early

Can add an explicit preload hint but it’s additional complexity




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: