Browse Source

minor fixes on TIFF handling

master
tonton th 2 years ago
parent
commit
3223caa03b
  1. 7
      funcs/fimg-tiff.c
  2. 6
      tools/fimg2tiff.c

7
funcs/fimg-tiff.c

@ -43,8 +43,9 @@ if (verbosity) { @@ -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); @@ -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);

6
tools/fimg2tiff.c

@ -46,7 +46,7 @@ if (grisaille) { @@ -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; @@ -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);

Loading…
Cancel
Save