This release improves support for Microsoft Windows and fixes several bugs.
MS Windows: Added support for Unicode command-line arguments.
MS Windows: Enabled support for building a DLL.
Improved quality of accelerated symbol picking (the default with
-w 6and lower), especially along sharp edges.
The XWD loader now supports unaligned image data, which can occur when the header is of an uneven length. Such images will no longer be rejected.
#100 Reading image data from stdin fails on Windows (reported by @TransparentLC).
#104 Artifacts with transparent animations on Kitty (reported by @acxz).
#108 Bad interaction with lolcat (reported by @eMPee584).
#112 Bad documentation for -c default (reported by @jwilk).
#113 Autogen/build fails on CentOS 7 (partial solution) (reported by @ivanshatsky).
huntr.dev: Uncontrolled memory allocation in lodepng (reported by @JieyongMa).
-lmshould not be in pkg-config
--watchswitch was broken with the introduction of
A bug crept into the previous release that prevented successful package builds in some environments. This has been fixed.
- Increased GLib minimum version to 2.26.
- Enabled a few compiler warnings not included in
-Wall -Wextrain order to catch more potential issues early. Also started using
- Silenced deprecation warnings for older GLib APIs that we would like to keep using a bit longer.
- Bug fixes:
#96 Regression: Fails to build on Linux/Debian (reported by @cdluminate).
This release fixes one important input validation bug and several instances of undefined behavior revealed by fuzzing.
Increased GLib minimum version to 2.20.
Added 12 new test inputs, including bad inputs to handle gracefully.
Added a few symbols to API documentation that were accidentally left out.
- huntr.dev CVE-2022-2061: Out-of-bounds read in libnsgif's lzw_decode() (@sudhackar of CrowdStrike).
- [unfiled] Undefined behavior in libnsgif due to uninitialized frame fields.
- [unfiled] Signed integer overflow in chafa_pack_color().
- [unfiled] Integer overflow in normalization pass on some images.
- [unfiled] Potential unaligned access with corrupt XWD images.
- [unfiled] Integer overflow in quantization on some images.
- [unfiled] Calculating offset from NULL pointer in LodePNG.
This is a feature release with new image loaders aimed at phasing out ImageMagick. It also has new convenience functions, character art improvements, tests and bug fixes.
Special thanks go to the very fine security researchers at huntr.dev for their help in hardening Chafa over the last few releases.
The ImageMagick dependency is now optional and deprecated. Packagers are encouraged to drop the ImageMagick dependency (
--without-imagemagick) and add direct dependencies on relevant image codecs. ImageMagick support will be removed in a future release.
Added image loaders for the following formats: JPEG, SVG, TIFF, WebP. Like the existing GIF, PNG and XWD loaders, these are much faster and generally safer than their ImageMagick counterparts. If ImageMagick is enabled, it will be used as a fallback. Supported image loaders will be listed in the
Implemented a 16/8 mode producing 8 colors and an additional 8 bright foreground-only colors for a total of 16 foreground and 8 background colors. When using ANSI escape sequences in symbol mode, the sequence for bold text is used to enable bright colors. This scheme corresponds to that of the IBM PC's VGA hardware text modes and was popular with terminal emulators in the late 1980s to early 2000s.
With a few tweaks, output from this mode can be turned into ANSI art scene .ANS files compatible with utilities like the wonderful Ansilove, e.g:
$ chafa -f symbols -c 16/8 -s 80 --symbols space+solid+half --fill stipple \ in.jpg | tr -d '\n' | iconv -c -f utf8 -t cp437 > out.ans $ ansilove out.ans -o out.png
New builtin Latin symbols (available with
--symbols latin). This class comprises most of the symbols from the Latin-1 Supplement, Latin Extended-A and -B, IPA Extensions and Spacing Modifier Letters plus a few Latin-like symbols from other ranges, using Terminus as the reference font. The ASCII class is also a subset of this class.
Reworked ASCII symbols to be more representative of modern terminal fonts. As with the other Latin ranges, the reference font is now Terminus.
--scale <n>. This takes a real number specifying the on-screen scaling factor relative to the input's pixel size, respecting the terminal size. The special argument
maxwill fit the output to the terminal. The defaults are 1.0 for iTerm, Kitty and sixels, and 4.0 for symbols. Suggested by @ploum in #84.
Added a battery of simple tests that can be run with
configurefriendlier. It's now more lenient with dependencies, and the summary is more detailed and colorized if possible.
- #62 Too big alloc on bogus terminal dimensions (reported by @sotpapathe and @cdluminate).
- huntr.dev: Null pointer dereference caused by calling post_func on unused batch entries (reported by @Han0nly).
- [unfiled] Small memory leaks when using iTerm and Kitty formats.
- [unfiled] Wide symbol coverages leaked in symbol map destructor.
- [unfiled] No error code if files failed to load.
This release fixes multiple input validation issues. These were found in the
chafa command-line tool and do not affect the library backend.
Improved input validation in the XWD loader.
huntr.dev: Buffer over-read when compiled with
-O0or non-x86 target (reported by @JieyongMa).
This release adds security/responsible disclosure guidelines and fixes a few issues with input validation in the
chafa command-line tool.
Added disclosure guidelines in
SECURITY.md(suggested by @JamieSlome).
- huntr.dev: Null pointer dereference in libnsgif with crafted GIF file (reported by @JieyongMa).
- [unfiled] File magic would not effectively rule out internal loaders.
- [unfiled] Very big images could cause absurd allocation requests triggering an abort in the loader.
This is a feature release focused on compatibility, presentation and ergonomics.
--polite <bool>. On by default. Can be turned off to correct issues caused by previous terminal state (e.g. no sixel scrolling) and improve presentation (e.g. by temporarily hiding the cursor). This can leave the terminal in an altered state, which is somewhat rude.
--threads <n>. Allows manually specifying the number of threads to use. Defaults to one per detected logical CPU core.
When invoked with redirected input and no arguments, act like a filter as if invoked with
-. Here's an example that downloads an image, converts it to Unicode text and mails it to
$ curl https://hpjansson.org/chafa/img/lc.jpg \ | chafa -f symbols -c none -s 77 --invert --dither bayer \ | mailx firstname.lastname@example.org
If input or output is being redirected, default to playing animations only once instead of looping forever. This can be overridden with
Replaced obsolete Autoconf macros (@mikelolasagasti).
Improved image loaders:
- GIF: Load GIF87a images as well as GIF89a.
- PNG: Add an internal copy of LodePNG, bypassing ImageMagick. This improves performance and helps with eventually phasing out the latter.
- XWD: Support images generated by
Improved terminal support: