[hb-view] Use envvar HB_CHAFA=0 to disable Chafa output

This commit is contained in:
Behdad Esfahbod 2022-07-14 15:57:43 -06:00
parent 76e6feb77f
commit 2da36cf99a
1 changed files with 5 additions and 1 deletions

View File

@ -195,7 +195,11 @@ helper_cairo_surface_write_to_ansi_stream (cairo_surface_t *surface,
if (width && height) if (width && height)
{ {
#ifdef HAVE_CHAFA #ifdef HAVE_CHAFA
if (true) const char *env = getenv ("HB_CHAFA");
bool chafa = true;
if (env)
chafa = atoi (env);
if (chafa)
chafa_print_image_rgb24 (data, width, height, stride); chafa_print_image_rgb24 (data, width, height, stride);
else else
#endif #endif