Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for loading miniatures #14

Open
saidwho12 opened this issue Aug 15, 2023 · 2 comments
Open

Support for loading miniatures #14

saidwho12 opened this issue Aug 15, 2023 · 2 comments

Comments

@saidwho12
Copy link

saidwho12 commented Aug 15, 2023

I have something like this in my Go website:

<img intrinsicsize="124x70" width="124" height="70" src="/api/uploads/2023/08/1692059893-20230725140644.jxl"/>

I am using the wasm/multi-threaded version of jxl.min.js and I am trying to force it to load a miniature version of the image, but seems like instrinsicsize and width and height are not doing anything. It could be cause of my CSS but I would assume that this would load regardless because insrinsicsize is set.

This would be a killer feature for my site and would save me a ton of extra work in making miniatures etc because the time to decode is a bit long. Takes longer than AVIF to load, I tested with 12 HD size images with JXL it took like 12 secs with caching disabled whereas AVIF was 6 seconds with no caching. If there is any SIMD/optimization work that needs to be done I'm ready to help out on it because to me JXL is a better format all around, it supports miniatures, animations, transparency, I want to use this exclusively but the speed has to be there as well.

I'm testing on Chrome/Firefox I got a Ryzen 7 3700X and 32GB 3000MT/s DDR4 memory. On mobile it's much slower than on my PC.

@saidwho12
Copy link
Author

I found also another big problem, I'm getting one get request of almost a meg per thread. It's really unpractical to use like this.

image

@niutech
Copy link
Owner

niutech commented Aug 16, 2023

@saidwho12 There is no instrinsicsize attribute for <img> element. The proposal was dropped. That said, could you provide a minimal demo using JSbin, JSfiddle etc.?

The subsequent *.wasm and *.js requests should be loaded from the cache. Do you have cache turned off in your dev tools?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants