minor fixes on TIFF handling

This commit is contained in:
Tonton Th 2020-08-22 17:38:27 +02:00
parent 301a0133e7
commit 3223caa03b
2 changed files with 7 additions and 6 deletions

View File

@ -43,8 +43,9 @@ if (verbosity) {
} }
tiff = TIFFOpen(fname, "w"); tiff = TIFFOpen(fname, "w");
if (NULL==tiff) {
printf("tiff at %p\n", tiff); return -6;
}
TIFFSetField(tiff, TIFFTAG_IMAGEWIDTH, src->width); TIFFSetField(tiff, TIFFTAG_IMAGEWIDTH, src->width);
TIFFSetField(tiff, TIFFTAG_IMAGELENGTH, src->height); TIFFSetField(tiff, TIFFTAG_IMAGELENGTH, src->height);
@ -60,7 +61,7 @@ TIFFSetField(tiff, TIFFTAG_SOFTWARE, ligne);
foo = src->width * 3; foo = src->width * 3;
foo = TIFFDefaultStripSize(tiff, foo); 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); TIFFSetField(tiff, TIFFTAG_ROWSPERSTRIP, foo);

View File

@ -46,7 +46,7 @@ if (grisaille) {
foo = fimg_write_as_tiff(&fimg, dstname, 0); foo = fimg_write_as_tiff(&fimg, dstname, 0);
if (foo) { if (foo) {
fprintf(stderr, "%s: saving as png '%s' -> %d\n", __func__, fprintf(stderr, "%s: saving as tiff '%s' -> %d\n", __func__,
dstname, foo); dstname, foo);
return -1; return -1;
} }
@ -59,9 +59,9 @@ return 0;
void help(int k) 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("options:");
puts("\t-g\tconvert to gray"); // puts("\t-g\tconvert to gray");
puts("\t-v\tincrease verbosity"); puts("\t-v\tincrease verbosity");
if (verbosity) fimg_print_version(1); if (verbosity) fimg_print_version(1);