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

Remove ImageMagick support #157

Closed
hpjansson opened this issue Aug 6, 2023 · 3 comments
Closed

Remove ImageMagick support #157

hpjansson opened this issue Aug 6, 2023 · 3 comments
Labels
compatibility Compatibility (e.g. terminal quirks) security Potential security issue tidiness Code organization and compliance

Comments

@hpjansson
Copy link
Owner

ImageMagick is a complex dependency that's hard to support. While it's an extremely versatile library, it's also got a kitchen sink approach that includes spawning external processes, causing inadvertent resource exhaustion and security issues. It would be nice to remove this dependency to cut down on risk/maintenance/packaging footprint.

That would leave the chafa CLI tool with support for the following formats: GIF, JPEG, PNG, SVG, TIFF, WebP, XWD. We may want to add support for AVIF as mentioned in #98 first. Potentially other important image formats too (suggestions welcome).

We'd lose support for formats like PDF (which many distributions disable anyway) and all video transcoding via IM (ew!). Users who want to keep using these can pipe to stdin like in the following examples:

ffmpeg -i https://i.imgur.com/sa1Tz6q.mp4 -f gif - | chafa -d inf
convert https://oig.nasa.gov/docs/IG-21-025.pdf[0] gif:- | chafa -t 1 --bg white

...and the performance will be better too.

@hpjansson hpjansson added compatibility Compatibility (e.g. terminal quirks) security Potential security issue tidiness Code organization and compliance labels Aug 6, 2023
@jerch
Copy link

jerch commented Aug 9, 2023

QOI might be worth a look. It is not widespread as exchange format, but quite popular as internal image format in many apps. It has okish compression and is really fast for its small code footprint.

@hpjansson
Copy link
Owner Author

That would be nice to have, indeed. Since it's so little code, it would be easy to audit and fuzz test too.

@hpjansson
Copy link
Owner Author

AVIF and QOI support added, ImageMagick removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility (e.g. terminal quirks) security Potential security issue tidiness Code organization and compliance
Projects
None yet
Development

No branches or pull requests

2 participants