From 8225911a9c19f5c738397488ccebf510490536f3 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 18 Jul 2019 19:22:41 -0400 Subject: image_*(), text_*(), sgr(): Add error() output --- (limited to 'src/image.c') diff --git a/src/image.c b/src/image.c index 59716da..47bc94c 100644 --- a/src/image.c +++ b/src/image.c @@ -28,6 +28,7 @@ #include "font.h" #include "i18n.h" +#include "output.h" #include "text.h" struct image { @@ -43,6 +44,7 @@ image_new(const char *file_name) image = calloc(1, sizeof(*image)); if (!image) { + error(_("Cannot allocate memory for image object")); return NULL; } @@ -57,11 +59,13 @@ image_new(const char *file_name) image->png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (!image->png_ptr) { + error(_("Failed to create PNG structure")); return image_destroy(&image); } image->info_ptr = png_create_info_struct(image->png_ptr); if (!image->info_ptr) { + error(_("Failed to create PNG info structure")); return image_destroy(&image); } -- cgit v0.9.1