summaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-07-18 19:22:41 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-07-18 19:22:41 (EDT)
commit8225911a9c19f5c738397488ccebf510490536f3 (patch)
treee3c42fab0df409aeae0ab600ef3a7ad2d3ed8731 /src/image.c
parentfa13692468790adab90c43f8b5bcce4b201f479f (diff)
image_*(), text_*(), sgr(): Add error() output
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c4
1 files changed, 4 insertions, 0 deletions
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);
}