5
votes
Help needed with jpegli please
Hi
Seems we need to compile jpegli from git.
https://github.com/google/jpegli
I'm not able to do this at present.
Maybe a tildean person here is. :-)
I want to experiment and compare results with my installed mozjpeg.
Anybody know where there is a jpegli precompiled?
Something to drop into Linux usr/local/bin.
Or a windows executable to use with wine.
Blogpost... https://opensource.googleblog.com/2024/04/introducing-jpegli-new-jpeg-coding-library.html
https://github.com/google/jpegli/blob/main/BUILDING.md
Just follow these instructions exactly.
Sure. I compiled these with gcc. It includes two binaries:
cjpegli(encoder) anddjpegli(decoder).Download zip via Dropbox. Link will probably expire eventually, when I clean up my files.
Hi Wes
Thanks, but it's asking for a shared libjpegli library that I don't have.
:-(
Message says...
cjpegli: error while loading shared libraries:
libjpegli_threads.so.0.12:
cannot open shared object file: No such file or directory
Ah, missing library. I'll have to see if I can include that in the build as well. Hang tight.
A "static" build, I think.
Okay, I've repackaged it and updated the link above. Give it another try.
No, it's not static enough.
cjpegli: error while loading shared libraries:
libjpeg.so.62:
cannot open shared object file: No such file or directory
The customer demands even more static. Alright, I've basically bundled every dependency that your Linux system might not have. Link is updated again.
If this doesn't work, I claim ignorance of using cmake as a pitiful web dev.
Hi
It's still trying to link to stuff...
cjpegli: /usr/lib/x86_64-linux-gnu/libstdc++.so.6:
version `GLIBCXX_3.4.29' not found (required by cjpegli)
Thanks for trying anyway.
:-)
It may honestly be easier to build yourself, as it'll use your systems libraries. In this case, I think my C++ runtime was too new for your system.
Nonetheless, one more for the road? Link is updated...
Gosh, I don't envy C devs.
No
It's trying to link to libc.so.6 and libm.so.6 now.
Maybe static builds is too complex for Linux.
So let it go.
Thanks again.
I can't find any cjpegli.exe or djpegli.exe in google search.
Perhaps Windows people won't touch this.
Funny that. :-(
I'm pretty confused, because libc should be included in basically every Linux distro. I can only guess that it's running in an extremely locked down environment like Docker, or a bare bones Linux distro designed for IoT or something.
In any case, I'm sorry I couldn't be of more help. Best of luck in finding an alternative solution.
It is included in every distro, but you two have different versions based on which OS you're running. It could be that one of you is very out-of-date, or just that one distro is a bit behind. Since yours was linked against one version and OP has a different one on their system, it's failing to link properly. This is one of the reasons containerization has gotten so popular.
Also, a
.sofile is a shared object file (a.dllin Windows) which is dynamically linked. A.afile is a statically linked library (I don't remember what windows calls their static libraries?.libor something?)I'm on a rolling release, so probably too recent.
It seems like glibc can be statically linked, but it's highly discouraged on Linux. I guess the solution is to simply build from an older system for wider compatibility.
Sharing libraries may once have made sense for saving disk space, but fully packaging and containerizing tools definitely seems like the way forward.
Hi
It's hit and miss linking with the different Linux versions.
I suppose jpegli team will eventually release v0.0.1 builds. e.g 64-bit Linux static.
In the meantime I think 32-bit cjpegli.exe might work with wine.
I don't mind if this thread quietly goes to sleep now.
So long, and thanks for all the fish. :-)
Hi
I've found a Windows 64-bit build.
Looks like it was compiled on April 19 2026.
And it runs OK with wine. :-)
This is a great use case for an LLM agent like Claude Code. OpenCode will let you use their LLM a bit for free.
So what I like to do when trying to build a project is poke around their
.github/workflowsif they have any. In this case, it looks like they have the build process documented in release.yaml. Edit: I like to reference the workflows directly because sometimes the written docs aren't up to date with the actual build process. (edit edit: whoops, linked to build_test, not release, fixed)If you need further help distilling this into a local build script, add what platform you're trying to compile for (e.g. distro + version + cpu arch) and one of the other tildren will probably help you before I find the time to take a stab at it.Aaaand they already did.
@Fishtail_Parka
build.sh
Seems to work in my limited testing. Built in ubuntu, ran on arch host.
Edit: There's also instructions for a windows build in release.yaml
May I ask if you're trying to link against it for perf reasons, or just to try out the library? If the latter, it looks like someone might've compiled it to wasm here.
Can't vouch for it, though, so it might steal your photo, download a car, or hack into your mainframes. Please do exercise caution.