Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-l.b-one.net (mx-l.one.com [91.198.169.59])
	by mail9.b-one.net (Postfix) with ESMTP id 39D5E400110
	for <info@awaresystems.be>; Fri, 16 Jan 2009 19:30:42 +0100 (CET)
X-Virus-Scanned: by one.com
X-Spam-Score: 0
X-Spam-Level: 
X-Spam-Status: No, score=0 tagged_above=0 required=6 tests=[none]
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144])
	by mx-l.b-one.net (Postfix) with ESMTP id 549C21D1DC5F
	for <info@awaresystems.be>; Fri, 16 Jan 2009 19:30:41 +0100 (CET)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id ADC211CF6EB50;
	Fri, 16 Jan 2009 13:29:51 -0500 (EST)
Received: from isadora.cybox.com (isadora.cybox.com [206.168.112.10])
	by lists.maptools.org (Postfix) with ESMTP id B16D81CF6EB4D
	for <tiff@lists.maptools.org>; Fri, 16 Jan 2009 12:29:25 -0500 (EST)
Received: from css2.css.com (vc7-1-36.dsl.netrack.net [199.45.160.84] (may be
	forged)) (authenticated)
	by isadora.cybox.com (msa 8.13.8/8.13.6) with ESMTP id n0GHTNvu010750; 
	Fri, 16 Jan 2009 10:29:24 -0700
Message-ID: <4970C3EE.20301@cybox.com>
Date: Fri, 16 Jan 2009 10:29:18 -0700
From: Richard Nolde <richard.nolde@cybox.com>
User-Agent: Thunderbird 2.0.0.14 (X11/20080501)
MIME-Version: 1.0
To: tiff@lists.maptools.org
References: <mailman.15.1231866002.21963.tiff@lists.maptools.org>
In-Reply-To: <mailman.15.1231866002.21963.tiff@lists.maptools.org>
Subject: [Tiff] tiff2ps option -m for imagemask operator
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: text/plain; charset="windows-1252"
Content-Transfer-Encoding: quoted-printable
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

Regarding invalid Postscript produced by tiff2ps when the -m flag is used.

I have narrowed the problem down to the case where the -m option is used =

without -2 or -3. The current code calls PSpage on each image and that =

code begins as follows:

void PSpage(FILE* fd, TIFF* tif, uint32 w, uint32 h)
{
char * imageOp =3D "image";
if ( useImagemask && (bitspersample =3D=3D 1) )
imageOp =3D "imagemask";
if ((level2 || level3) && PS_Lvl2page(fd, tif, w, h))
return;

There is no PS_LVL1page function in tiff2ps.c so there no special =

handling for useImagemask even though according to an online reference =

source, the imagemask operator is handled differently for Level1 and Level2.

imagemask
width heigh polarity matrix datasrc imagemask -
dict imagemask -
uses a monochrome sampled image as a stencil mask of 1-bit samples to =

control where to apply paint to the current page in the current color =

(see =93Stencil Masking=94on page 302.)In the first form of the operator =

(LanguageLevel 1), the parameters are specified as separate operands. In =

the second form (LanguageLevel 2), the parameters are contained as =

entries in an image dictionary dict, which is supplied as the single =

operand.The behavior of the operator is the same in both forms.imagemask =

uses the width, height, matrix, and datasrc operands in precisely the =

same way the image operator uses them.

I have a patch to disallow -m without -2 or -3.

Richard Nolde

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
