~jkaivo/freeonebook

e791b3713a8e9932e48dcb141275d11acc199538 — Jakob Kaivo 3 years ago 6d5b39e
more error checking
1 files changed, 14 insertions(+), 0 deletions(-)

M convert.c
M convert.c => convert.c +14 -0
@@ 10,8 10,22 @@ int convert(const char *in, const char *out, int width, int height)

	if (!IsMagickWandInstantiated()) {
		MagickWandGenesis();
	}

	if (w == NULL) {
		w = NewMagickWand();
		if (w == NULL) {
			printf("couldn't create MagickWand\n");
			return 1;
		}
	}

	if (pixel == NULL) {
		pixel = NewPixelWand();
		if (pixel == NULL) {
			printf("couldn't create PixelWand\n");
			return 1;
		}
	}

	if (!MagickReadImage(w, in)) {