Giter Club home page Giter Club logo

makejxl's People

Contributors

varnav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

makejxl's Issues

I am just trying to encode JPEG to JXL

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

  • Martin Eesmaa

Command injection vulnerbility

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.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.