AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
July 1998

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

1998.07.09 13:53 "tiffsplit in a cronjob", by Humzah Jaffar
1998.07.09 15:24 "Re: tiffsplit in a cronjob", by Bjorn Brox
1998.07.09 16:11 "Re: tiffsplit in a cronjob", by Rex Jolliff
1998.07.09 15:54 "Re: tiffsplit in a cronjob", by Doug Vander Wilt
1998.07.09 16:30 "Re: tiffsplit in a cronjob", by Phillip Griffith

1998.07.09 15:24 "Re: tiffsplit in a cronjob", by Bjorn Brox

Humzah Jaffar wrote this:
> 
> hello tiffnuts.
> i have a cronjob running every morning using the tiffsplit command (from
> tifflib on DEC unix) to count the number of files in several 100 multi-page
> tiffs that are transferred into our storage. then i count the number of
> "xfiles" formed. 
> problem: i always get a count of 0. however when i run the same cronjob
> manually on the exact same files, it splits the files and counts the xfiles
> accurately. any ideas why? or is there a more efficient way to figure out
> how many files are in a multipage tiff?

You probably get zero because the current directory  or user rights is
different from what is used when executing it manually.

Why don't you just write a small program using libtiff, like this one:

----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);
}
----

> TIA, humzah
> 
> 


-- 
Bjorn Brox, mailto:brox@corena.no, CORENA A/S, http://www.corena.no/
P.O.Box 1024, Kongsberg Naeringspark, N-3601 Kongsberg, NORWAY
Phone: +47 32737435, Fax: +47 32736877, Mobile: +47 92638590