varnav / makejxl Goto Github PK
View Code? Open in Web Editor NEWThis tool will bulk encode image files in given directory to JPEG-XL.
License: MIT License
This tool will bulk encode image files in given directory to JPEG-XL.
License: MIT License
Hello! I tried to follow these steps, but when I typed: makejxl.exe "c:\Users\username\Pictures\My Vacation" its example folder and I got a error:
cjxl not found
Traceback (most recent call last):
File "makejxl.py", line 86, in
main()
File "click\core.py", line 829, in call
File "click\core.py", line 782, in main
File "click\core.py", line 1066, in invoke
File "click\core.py", line 610, in invoke
File "makejxl.py", line 44, in main
exit(1)
NameError: name 'exit' is not defined
[30220] Failed to execute script makejxl
I already downloaded the cjxl, where do I put cjxl for path environment?
Please help me, @varnav !
Regards
The current code calls cjxl as a stitched-together shell command, and that's not safe: a filename with a semicolon in it would just create a second command.
You might ask about quoting, but the issue is the different default shells (cmd and sh) have different quoting methods.
I am on a phone right now, but the gist is to replace
convert_cmd = f'cjxl --quiet -s {speed} --num_threads={jobs} {fp} {newpath}'
conversion_return_code = run(convert_cmd, shell=True).returncode
with
convert_cmd = ['cjxl', '--quiet', '-s', speed, f'--num_threads={jobs}', fp, newpath]
conversion_return_code = run(convert_cmd).returncode
(It would be nice to add a '--',
before fp so the program does not recognize a name starting with -
as some invalid option, but i can't check if cjxl takes that yet.)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.