Received: by smtp02.oce.nl (4.1/SMI-4.1)
	id AA29366; Thu, 9 Jul 98 18:11:11 +0200
Received: from sgi.sgi.com (SGI.COM [192.48.153.1])
	by oce.nl (8.9.0/8.9.0) with ESMTP id SAA18202
	for <rvdt@oce.nl>; Thu, 9 Jul 1998 18:02:45 +0200 (MET DST)
Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) 
	by sgi.sgi.com (980309.SGI.8.8.8-aspam-6.2/980304.SGI-aspam:
       SGI does not authorize the use of its proprietary
       systems or networks for unsolicited or bulk email
       from the Internet.) 
	via ESMTP id IAA13490; Thu, 9 Jul 1998 08:59:31 -0700 (PDT)
	mail_from (owner-tiff@sgi.engr.sgi.com)
Received: (from majordomo-owner@localhost)
	by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF)
	id IAA64600
	for tiff-list;
	Thu, 9 Jul 1998 08:24:03 -0700 (PDT)
	mail_from (owner-tiff@sgi.sgi.com)
Received: from sgi.sgi.com (sgi.engr.sgi.com [192.26.80.37])
	by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF)
	via ESMTP id IAA90481
	for <tiff-relay@cthulhu.engr.sgi.com>;
	Thu, 9 Jul 1998 08:24:01 -0700 (PDT)
	mail_from (owner-tiff@sgi.sgi.com)
Received: from dms.corena.no (dms.corena.no [193.69.46.253]) 
	by sgi.sgi.com (980309.SGI.8.8.8-aspam-6.2/980304.SGI-aspam:
       SGI does not authorize the use of its proprietary
       systems or networks for unsolicited or bulk email
       from the Internet.) 
	via SMTP id IAA29409
	for <tiff@sgi.com>; Thu, 9 Jul 1998 08:23:49 -0700 (PDT)
	mail_from (brox@corena.no)
Received: from senja.corena.no by dms.corena.no (AIX 3.2/UCB 5.64/4.03)
          id AA23394; Thu, 9 Jul 1998 17:24:27 +0200
Received: by senja.corena.no (AIX 3.2/UCB 5.64/4.03)
          id AA21016; Thu, 9 Jul 1998 17:24:25 +0200
From: brox@corena.no (Bjorn Brox)
Message-Id: <9807091524.AA21016@senja.corena.no>
Subject: Re: tiffsplit in a cronjob
To: humzah@iserv.net (Humzah Jaffar)
Date: Thu, 9 Jul 1998 17:24:24 +0200 (CETdst)
Cc: tiff@sgi.com (TIFF Mailing List)
In-Reply-To: <2.2.32.19980709135329.00987214@iserv.net> from "Humzah Jaffar" at Jul 9, 98 09:53:29 am
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Sender: owner-tiff@fddi-sgi.sgi.com
Precedence: bulk

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
