Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-q.b-one.net (mx-q.one.com [91.198.169.248])
	by mail9.b-one.net (Postfix) with ESMTP id C4909400400
	for <info@awaresystems.be>; Mon, 26 Apr 2010 23:00:58 +0200 (CEST)
Received: by mx-q.b-one.net (Postfix, from userid 106)
	id B9512114875; Mon, 26 Apr 2010 23:00:58 +0200 (CEST)
X-Virus-Scanned: by one.com
X-Spam-Score: 0
X-Spam-Level: 
X-Spam-Status: No, score=0 tagged_above=0 required=4 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-q.b-one.net (Postfix) with ESMTP id EB8EF114875 for
 <info@awaresystems.be>; Mon, 26 Apr 2010 23:00:57 +0200 (CEST)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by
 lists.maptools.org (Postfix) with ESMTP id 7CDF71D201DE9; Mon, 26 Apr 2010
 16:00:08 -0500 (EST)
Received: from mail-ew0-f217.google.com (mail-ew0-f217.google.com
 [209.85.219.217]) by lists.maptools.org (Postfix) with ESMTP id 41C4A1D201D7C
 for <tiff@lists.maptools.org>; Mon, 26 Apr 2010 15:59:04 -0500 (EST)
Received: by ewy9 with SMTP id 9so3818619ewy.9 for <tiff@lists.maptools.org>;
 Mon, 26 Apr 2010 13:59:03 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.103.80.22 with SMTP id h22mr2621463mul.127.1272315543196;
 Mon,  26 Apr 2010 13:59:03 -0700 (PDT)
Received: by 10.103.218.17 with HTTP; Mon, 26 Apr 2010 13:59:03 -0700 (PDT)
In-Reply-To: <4BD5F391.5060106@sidefx.com>
References: <4BD5DDCA.2090808@sidefx.com> <4BD5F391.5060106@sidefx.com>
Date: Mon, 26 Apr 2010 16:59:03 -0400
Message-ID: <m2k64b49b171004261359i5d8feedag4f8bb8bdafa661a6@mail.gmail.com>
From: Olivier Paquet <olivier.paquet@gmail.com>
To: Edward Lam <edward@sidefx.com>
Cc: Tiff List <tiff@lists.maptools.org>
Subject: Re: [Tiff] Bug in tif_print.c for TIFFTAG_REFERENCEBLACKWHITE
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="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

On Mon, Apr 26, 2010 at 4:12 PM, Edward Lam <edward@sidefx.com> wrote:
> Edward Lam wrote:
> =A0> I have an 6-Bit RGBA image and using tiffinfo on it gives:
>
> Er, I meant 8-bit here of course.
>
> I also noticed another problem with the number of expected floats for
> TIFFTAG_REFERENCEBLACKWHITE in the documentation for TIFFSetField:
> =A0 =A0 =A0http://libtiff.maptools.org/man/TIFFSetField.3tiff.html
> where it says:
> =A0 =A0 =A02*SamplesPerPixel

That's also what the TIFF spec says in appendix A. Of course, other
mentions of the tag specify 6 float. The spec also says:

    The ordering of pairs is the same as those for pixel components of
    the PhotometricInterpretation type. ReferenceBlackWhite can be applied
    to images with a PhotometricInterpretation value of RGB or YCbCr.
    ReferenceBlackWhite is not used with other PhotometricInterpretation va=
lues.

Which implies the tag will only ever have 6 values as both RGB and
YCbCr have 3 components. libtiff always reads/writes 6 floats so it is
definitely wrong to try to display 8 values.

Are there any objections to hardcoding the output of 6 values?

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