Received: from [192.48.153.1] by phillip.cerious.com (NTMail 3.03.0017/7.aaxh) with ESMTP id pcrews for <pcrews@cerious.com>; Thu, 9 Jul 1998 13:00:29 -0400
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 JAA03265; Thu, 9 Jul 1998 09:44:07 -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 JAA14151
	for tiff-list;
	Thu, 9 Jul 1998 09:13:33 -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 JAA30655
	for <tiff-relay@cthulhu.engr.sgi.com>;
	Thu, 9 Jul 1998 09:13:30 -0700 (PDT)
	mail_from (owner-tiff@sgi.sgi.com)
Received: from ymps5 (ymps5.ymp.gov [198.147.246.51]) 
	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 JAA20067
	for <tiff@sgi.com>; Thu, 9 Jul 1998 09:13:29 -0700 (PDT)
	mail_from (Rex_Jolliff@notes.ymp.gov)
From: Rex_Jolliff@notes.ymp.gov
Received: from ymln11.ymp.gov by ymps5.ymp.gov (PMDF V5.1-7 #23027)
 with SMTP id <0EVU4Y298002VS@ymps5.ymp.gov> for tiff@sgi.com; Thu,
 9 Jul 1998 09:10:50 -0700 (PDT)
Received: by ymln11.ymp.gov(Lotus SMTP MTA v4.6.1  (569.2 2-6-1998))
 id 8825663C.00591761 ; Thu, 09 Jul 1998 09:13:06 -0700
Date: Thu, 09 Jul 1998 09:11:07 -0700
Subject: Re: tiffsplit in a cronjob
To: brox@corena.no (Bjorn Brox)
Cc: humzah@iserv.net (Humzah Jaffar), tiff@sgi.com (TIFF Mailing List)
Message-id: <8825663C.0058976F.00@ymln11.ymp.gov>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-disposition: inline
X-Lotus-FromDomain: CRWMS
Sender: owner-tiff@fddi-sgi.sgi.com
Precedence: bulk


brox@corena.no (Bjorn Brox)  wrote:
>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);
>}
>----

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.



