From 3223caa03b532e4c9cdcc5ec4df789fa62ad44a5 Mon Sep 17 00:00:00 2001 From: tonton th Date: Sat, 22 Aug 2020 17:38:27 +0200 Subject: [PATCH] minor fixes on TIFF handling --- funcs/fimg-tiff.c | 7 ++++--- tools/fimg2tiff.c | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/funcs/fimg-tiff.c b/funcs/fimg-tiff.c index d00d0bfe..bd66fdf4 100644 --- a/funcs/fimg-tiff.c +++ b/funcs/fimg-tiff.c @@ -43,8 +43,9 @@ if (verbosity) { } tiff = TIFFOpen(fname, "w"); - -printf("tiff at %p\n", tiff); +if (NULL==tiff) { + return -6; + } TIFFSetField(tiff, TIFFTAG_IMAGEWIDTH, src->width); TIFFSetField(tiff, TIFFTAG_IMAGELENGTH, src->height); @@ -60,7 +61,7 @@ TIFFSetField(tiff, TIFFTAG_SOFTWARE, ligne); foo = src->width * 3; foo = TIFFDefaultStripSize(tiff, foo); -fprintf(stderr, "default strip size %d\n", foo); +if (verbosity) fprintf(stderr, "default strip size %d\n", foo); TIFFSetField(tiff, TIFFTAG_ROWSPERSTRIP, foo); diff --git a/tools/fimg2tiff.c b/tools/fimg2tiff.c index b65c1ef3..5589c519 100644 --- a/tools/fimg2tiff.c +++ b/tools/fimg2tiff.c @@ -46,7 +46,7 @@ if (grisaille) { foo = fimg_write_as_tiff(&fimg, dstname, 0); if (foo) { - fprintf(stderr, "%s: saving as png '%s' -> %d\n", __func__, + fprintf(stderr, "%s: saving as tiff '%s' -> %d\n", __func__, dstname, foo); return -1; } @@ -59,9 +59,9 @@ return 0; void help(int k) { -puts("usage:\n\tfimg2tiff [options] foo.fimg bar.png"); +puts("usage:\n\tfimg2tiff [options] foo.fimg bar.tiff"); puts("options:"); -puts("\t-g\tconvert to gray"); +// puts("\t-g\tconvert to gray"); puts("\t-v\tincrease verbosity"); if (verbosity) fimg_print_version(1);