Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx3.public.one.com ([10.246.18.23])
	by mail6.local.one.com (Dovecot) with LMTP id kPEsFJ+KCFlkJAAAsyOMew
	for <filtered@awaresystems.be>; Tue, 02 May 2017 15:58:39 +0000
X-HalOne-ID: 340a3d35-2f50-11e7-a2ed-b82a72d83ab6
Received: from mail-io0-f169.google.com (unknown [209.85.223.169])
	by mx3.public.one.com (Halon) with ESMTPS
	id 340a3d35-2f50-11e7-a2ed-b82a72d83ab6;
	Tue, 02 May 2017 15:58:38 +0000 (UTC)
Received: by mail-io0-f169.google.com with SMTP id a103so161104135ioj.1
        for <filtered@awaresystems.be>; Tue, 02 May 2017 08:58:38 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-original-authentication-results:x-gm-message-state:delivered-to
         :from:to:date:message-id:mime-version:thread-index:content-language
         :subject:precedence:list-id:list-unsubscribe:list-archive:list-post
         :list-help:list-subscribe:mime-version:sender:errors-to;
        bh=y6WgDxcen7FHj3gy2KDJhUDonANzv5MwrWPipE+Lcyw=;
        b=XMRpKYH9k/tLNTXGfVFySkdmARG4G2bL+jAXCmSNWhPeCVN3sYhdaU9crQOyD9i5Wn
         4ZDDffrbpep7WgiOKIESNWT2t5uUkdN8W7fn0mARn8+PBVfAyMToZBsVaggcphCRc16k
         RfibvClZyPR2eWGeIx1Fio3tAn201qCU2fFzhH3hCLqq769OwTejeM9DE9nUD2IjY8O6
         DL+KxzDR8VQGBt72XspDxacB3GIYALnSB1k/s2N4cklzmh405K7lIaNttV8lF9pkzGA2
         WF8QcwM1vo+TcQfb+nBdSrKoFTJqcWUpfhEkhIqk3DAXrQ63jK7oeJ09/DjiIz9OOJto
         nljA==
X-Original-Authentication-Results: mx.google.com;       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org
X-Gm-Message-State: AN3rC/51qe0qj3kLG6tfMHuBVPXiSfPMy428K0dfcCrUgJJOPAM+qmkI
	m7bsIV5zre8Suax7Fu2rFWTizD3P6U8VMwIShyxWkg==
X-Received: by 10.157.12.193 with SMTP id o1mr12089592otd.154.1493740716681;
        Tue, 02 May 2017 08:58:36 -0700 (PDT)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.202.242.65 with SMTP id q62csp1971134oih;
        Tue, 2 May 2017 08:58:35 -0700 (PDT)
X-Received: by 10.28.111.65 with SMTP id k62mr2614477wmc.88.1493740714601;
        Tue, 02 May 2017 08:58:34 -0700 (PDT)
Return-Path: <tiff-bounces@lists.maptools.org>
Received: from lists.maptools.org (ks365428.kimsufi.com. [94.23.4.142])
        by mx.google.com with ESMTP id e25si20217828wra.213.2017.05.02.08.58.33;
        Tue, 02 May 2017 08:58:34 -0700 (PDT)
Received-SPF: neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) client-ip=94.23.4.142;
Authentication-Results: mx.google.com;
       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id D004035C04D;
	Tue,  2 May 2017 10:56:20 -0500 (EST)
Received: from Mail.MaSSoftware.Com (massoftware.com [74.200.71.197])
	by lists.maptools.org (Postfix) with ESMTPS id 2F69535C04B
	for <tiff@lists.maptools.org>; Tue,  2 May 2017 10:55:59 -0500 (EST)
Received: from localmail2.massoftware.com
	(CPE005056000101-CM84948c576700.cpe.net.cable.rogers.com
	[99.236.101.199])
	by Mail.MaSSoftware.Com (8.13.1/8.13.1) with ESMTP id v42Ftu7g005767
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <tiff@lists.maptools.org>; Tue, 2 May 2017 11:55:56 -0400
Received: from MASDEVMAIL ([192.168.127.151]) (authenticated bits=0)
	by localmail2.massoftware.com (8.14.7/8.14.7) with ESMTP id
	v42Fthd4017661
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <tiff@lists.maptools.org>; Tue, 2 May 2017 11:55:43 -0400
From: "Michael Shiels [ MaS Software Inc ]" <MaSSoft@massoftware.com>
To: <tiff@lists.maptools.org>
Date: Tue, 2 May 2017 11:55:53 -0400
Message-ID: <330c01d2c35c$94292e20$bc7b8a60$@MaSSoftware.Com>
MIME-Version: 1.0
X-Mailer: Microsoft Outlook 14.0
Thread-Index: AdLDXBztsjcFw3SBTqCcq1IcPj13kw==
Content-Language: en-us
Subject: [Tiff] Possible patch/update to allow for a black/white image that
	has SAMPLEFORMAT tag set
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: multipart/mixed; boundary="===============1479630540=="
Mime-version: 1.0
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

This is a multipart message in MIME format.

--===============1479630540==
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_330D_01D2C33B.0D1C2200"
Content-Language: en-us

This is a multipart message in MIME format.

------=_NextPart_000_330D_01D2C33B.0D1C2200
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

We have run into a number of these and found changing this code in
tif_dirread.c but in the older 3.5.6/3.5.7 era code.  I don't seem to have
saved a copy of one of those images for comparison/testing purposes.  But
basically the setfield would fail on _SAMPLEFORMAT for a 1bpp image.   So we
attempt to copy the tag data but do not consider it an error - possibly not
best solution, but we needed something quick in our case.

 

                              case TIFFTAG_DATATYPE:

                              case TIFFTAG_SAMPLEFORMAT:

                                             if
(!TIFFFetchPerSampleShorts(tif, dp, &iv) ||

                                                 !TIFFSetField(tif,
dp->tdir_tag, iv))

                                                            goto bad;

                                             break;

 

 

To this

 

                              case TIFFTAG_DATATYPE:

                                             if
(!TIFFFetchPerSampleShorts(tif, dp, &iv) ||

                                                 !TIFFSetField(tif,
dp->tdir_tag, iv))

                                                            goto bad;

                                             break;

                              case TIFFTAG_SAMPLEFORMAT:

                                             if
(TIFFFetchPerSampleShorts(tif, dp, &iv))

                                                 TIFFSetField(tif,
dp->tdir_tag, iv);

                                             break;

 

 

Would resolve the issue 


------=_NextPart_000_330D_01D2C33B.0D1C2200
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta =
http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii"><meta name=3DGenerator content=3D"Microsoft Word 14 =
(filtered medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DEN-US link=3Dblue =
vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal>We have =
run into a number of these and found changing this code in tif_dirread.c =
but in the older 3.5.6/3.5.7 era code.&nbsp; I don&#8217;t seem to have =
saved a copy of one of those images for comparison/testing =
purposes.&nbsp; But basically the setfield would fail on _SAMPLEFORMAT =
for a 1bpp image.&nbsp;&nbsp; So we attempt to copy the tag data but do =
not consider it an error &#8211; possibly not best solution, but we =
needed something quick in our case.<o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case =
TIFFTAG_DATATYPE:<o:p></o:p></p><p =
class=3DMsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&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&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp; goto bad;<o:p></o:p></p><p =
class=3DMsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
break;<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>To =
this<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case =
TIFFTAG_DATATYPE:<o:p></o:p></p><p =
class=3DMsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
break;<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>Would =
resolve the issue <o:p></o:p></p></div></body></html>
------=_NextPart_000_330D_01D2C33B.0D1C2200--


--===============1479630540==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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