Return-Path: owner-tiff@olympiakos.com
Return-Path: <owner-tiff@olympiakos.com>
Received: from localhost (localhost [127.0.0.1])
	by at1895.spb.edu (8.12.1/8.12.1/Debian -5) with ESMTP id g2K4PE80003879
	for <dron@localhost>; Wed, 20 Mar 2002 07:25:42 +0300
Received: from eudoramail.com [209.185.123.45]
	by localhost with POP3 (fetchmail-5.9.0)
	for dron@localhost (single-drop); Wed, 20 Mar 2002 07:25:42 +0300 (MSK)
Received: from gate7.olympiakos.com ([64.32.199.150]) by shared1-mail.whowhere.com; Tue Mar 19 18:37:31 2002
Received: from localhost (daemon@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id MAA00490;
	Tue, 19 Mar 2002 12:56:16 -0500
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Tue, 19 Mar 2002 12:54:13 -0500
Received: (from majordom@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) id MAA00474
	for tiff-outgoing; Tue, 19 Mar 2002 12:54:13 -0500
X-Authentication-Warning: gate7.olympiakos.com: majordom set sender to owner-tiff@olympiakos.com using -f
Received: from fax.tgivan.com ([202.144.239.157])
	by gate7.olympiakos.com (8.9.3/8.9.3) with ESMTP id MAA00471
	for <tiff@olympiakos.com>; Tue, 19 Mar 2002 12:54:12 -0500
Received: from aukland.yp.tgx ([192.9.200.62] helo=aukland.tgivan.com)
	by fax.tgivan.com with smtp (Exim 3.20 #1)
	id 16nNoJ-0003uS-00
	for tiff@olympiakos.com; Tue, 19 Mar 2002 09:54:11 -0800
Received: from lima by aukland.tgivan.com (SMI-8.6/SMI-SVR4)
	id JAA15537; Tue, 19 Mar 2002 09:54:10 -0800
Message-Id: <200203191754.JAA15537@aukland.tgivan.com>
Date: Tue, 19 Mar 2002 09:54:10 -0800 (PST)
From: Stephen Rasku <stephen@tgivan.com>
Reply-To: Stephen Rasku <stephen@tgivan.com>
Subject: I don't want multiple strips
To: tiff@olympiakos.com
MIME-Version: 1.0
Content-Type: MULTIPART/mixed; BOUNDARY=Band_of_Jays_821_000
X-Mailer: dtmail 1.3.0 @(#)CDE Version 1.3.5 SunOS 5.7 sun4u sparc 
Sender: owner-tiff@olympiakos.com
Precedence: bulk
Status: RO
Content-Length: 2843
Lines: 101

--Band_of_Jays_821_000
Content-Type: TEXT/plain; charset=us-ascii
Content-MD5: BQEKRqplbImZYKQ7YvEfxA==

The attached program generates a TIFF file that tiffinfo doesn't like. 
 I want all the rows in one strip but it creates multiple strip 
offsets and when I run tiffinfo on the generated tiff, I get:

	tiffcreate.tif: Warning, incorrect count for field 	
	"StripOffsets" (10, expecting 1); tag ignored.

-- 
Stephen Rasku			E-mail:	stephen@tgivan.com
Senior Software Engineer	Web:	http://www.pop-star.net/
TGI Technologies

--Band_of_Jays_821_000
Content-Type: TEXT/x-sun-c-file; name="tiffcreate.c"; charset=us-ascii
Content-Description: tiffcreate.c
Content-MD5: QX3LuE3FpIAyXXrGSspy1Q==

/************************************************************************
 *   Entity Id		: $Id$
 *   Package		: tiff
 *   Purpose		:
 *
 *   Date of Creation	: Feb 27, 2002
 *   Version Number	: $Revision$
 *   Last Updated	: $Date$
 *
 *   Functions		:
 *
 *   Author		: Stephen Rasku
 *   Notes		:
 *
 *   Copyright 2002 by TGI Technologies Ltd.  All rights reserved.
 ************************************************************************/

#ifndef lint
static const char tiffcreate_c_id[] = "@(#) tiff::tiffcreate.c	$Revision$";
#endif

#define __tiffcreate_c
#include <stdio.h>
#include <stdarg.h>
#include "tiffio.h"

#define OUTFILE		"tiffcreate.tif"
#define NUMROWS		10
#define IMAGE_WIDTH	16
#define BYTES_PER_BUF	IMAGE_WIDTH/8

unsigned char blackbuf[BYTES_PER_BUF];
unsigned char whitebuf[BYTES_PER_BUF];

void myHandler(const char *module, const char *fmt, va_list ap)
{
    fprintf(stderr, "%s: ", module);
    fprintf(stderr, fmt, ap);
    fprintf(stderr, "\n");
}

main(int argc, char *argv[])
{

    TIFFSetErrorHandler(myHandler);
    do {
	TIFF *tif;
	int row;

	memset(blackbuf, -1, BYTES_PER_BUF);
	memset(whitebuf, 0, BYTES_PER_BUF);

	if ( !( tif = TIFFOpen(OUTFILE, "w") ) )
	{
	    fprintf(stderr, "%s: Error opening file %s\n", argv[0], OUTFILE);
	    break;
	}

	if ( !(TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_CCITTFAX3) &&
	    TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, (unsigned)IMAGE_WIDTH) &&
	    TIFFSetField(tif, TIFFTAG_IMAGELENGTH, (unsigned)NUMROWS) &&
	    TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, (unsigned)NUMROWS) &&
	    TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG) &&
	    TIFFSetField(tif, TIFFTAG_YRESOLUTION, 196.) &&
	    TIFFSetField(tif, TIFFTAG_XRESOLUTION, 204.) ) ) break;
	for (row = 0; row < NUMROWS; ++row)
	   if ( TIFFWriteEncodedStrip(tif, row, row % 2 ? blackbuf : whitebuf,
		BYTES_PER_BUF) == -1) break;

	TIFFWriteDirectory(tif);

	TIFFClose(tif);
    } while(0);
    return(1);
}

--Band_of_Jays_821_000--

To subscribe or unsubscribe email tiff-request@olympiakos.com with subscribe
or unsubscribe in the email body.  Libtiff home page: http://www.libtiff.org

