1998.07.09 13:53 "tiffsplit in a cronjob", by Humzah Jaffar

1998.07.09 16:11 "Re: tiffsplit in a cronjob", by Rex Jolliff

 ----tiff_imagecount.c----
#include <stdlib.h>

#include "tiffio.h"

void main(int argc, char *argv[])
{
    TIFF *tif;

    if (argc != 2 || !(tif = TIFFOpen(argv[1], "r"))) {
        (void)fprintf(stderr, "USAGE: %s image.tif\n", argv[0]);
        exit(1);
    }
    (void)printf("%hu\n", TIFFNumberOfDirectories(tif));

    TIFFClose(tif);
    exit(0);
}
----

There is a possible problem with this. If there are thumbnails in the document wont they get counted as separate files? Perhaps you want this though, otherwise a simple loop that moves to each directory and counts those that are not thumbnails would not be much more complex than this.

Rex.