Skip to content

thumbnail: Support jxl and plumbing for future formats. #1058

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Quackdoc
Copy link
Contributor

@Quackdoc Quackdoc commented Jul 8, 2025

This will allow using jxl-oxide for thumbnail creation, it seems to be working well for me but it's a draft for a couple reasons, the primary one is im not sure the best resource limit to set. I feel like this should be set in a configuration, but even then I don't know what defaults should be used.

the current value I found to be necessary for some of my images, but likely way to high for lower end systems. (that being said, hitting an oom case in cosmic-files is much better then having a thumbnailer oom since oomd will actually kill cosmic-files instead of the entire compositor)

@jackpot51
Copy link
Member

I would recommend a much lower memory limit and potentially a lower number of jobs.

@Quackdoc
Copy link
Contributor Author

added configuration (just the file config) and changed the default to 4 parallel with with a max of 2000mb usage, which is inline with image-rs 512mib default limit. Also added adjustment for max file size to check for. image-rs also has a configurable limit too now.

I figure the defaults should be good enough for low end systems.

@Quackdoc
Copy link
Contributor Author

I think this is more or less ready to review with a small cleanups I haven't pushed. should jxl-oxide try to convert the thumbnail to sRGB? It will help thumbnails look better, but may give false impression when an image is for instance an HDR image.

@Quackdoc Quackdoc marked this pull request as ready for review July 11, 2025 04:43
@jackpot51
Copy link
Member

Yes, the thumbnails should be sRGB.

@Quackdoc
Copy link
Contributor Author

ah, so jxl-oxide's image-rs doesn't currently handle the colorspace conversions, I can probably add it to jxl-oxide but that would probably put off the PR for a bit.

Image-rs doesn't handle colorspace conversions anyways so the current configuration is inline with what it was doing before, I think using an external cms instead of exposing jxl-oxide's cms is probably better for consistency and can be done in a separate PR.

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

Successfully merging this pull request may close these issues.

2 participants