Return-Path: <SRS0=AVXE=JO=lists.osgeo.org=tiff-bounces@osgeo.org>
Delivered-To: filtered@awaresystems.be
Received: from mx1.pub.mailpod8-cph3.one.com ([10.27.38.11])
	by mailstorage22.cst.mailpod8-cph3.one.com with LMTP
	id gMg7HF09wWX8UAAAwT5NuQ
	(envelope-from <SRS0=AVXE=JO=lists.osgeo.org=tiff-bounces@osgeo.org>)
	for <filtered@awaresystems.be>; Mon, 05 Feb 2024 19:56:13 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=custmx.one.com; s=20201015;
	h=sender:content-type:reply-to:from:list-subscribe:list-help:list-post:
	 list-unsubscribe:list-id:subject:mime-version:message-id:date:to:
	 x-halone-refid:x-halone-sa:from:x-halone-sa:x-halone-refid;
	bh=P4HLiyXwKMGUnvofvU+5AxrXw7xdV5go/tFlB9VS8w8=;
	b=pSmwciu4uQjOR8MkJbNOrsdHmrKzdIK3a1RCTvDNqSB1b8AJZLmJkx1TeuPHGq1VcZ0EMq8fagyCH
	 rCV86pnZxmmnsTR19nUENLI7grTazBntRiP6tjIo+ql+3yu7YcaxfMfQ++5tM2v1ZLJZQ4lBzMbTbc
	 T4/kveGSM6SoN2/ReRwgTaQ/cgsizazZe5JwXJk9wloArmo5FzyyXnyS53E39vnOMwKCHS5nPrKhzF
	 pN07gpTHMIgD1QsCyvZ6HB1H+fBeje8tFyyomsu5ylnXZAUlfRZPkzATS0TcQoy5w6pKaeLF60HldC
	 IXuXQqEcXaFWZo62e4ItGpZgxDeoa7g==
X-HalOne-SA: -1
X-HalOne-RefID: 155866::1707162972-F9966D62-8C671744/0/0
Authentication-Results: mx1.pub.mailpod8-cph3.one.com;
	spf=pass smtp.mailfrom=osgeo.org smtp.remote-ip=140.211.15.3;
	dmarc=pass header.from=lists.osgeo.org;
X-HalOne-ID: 9ca4669b-c460-11ee-ab60-98039b0f6c32
Received: from lists.osgeo.org (osgeo6.osgeo.osuosl.org [140.211.15.3])
	by mx1.pub.mailpod8-cph3.one.com (Halon) with ESMTP
	id 9ca4669b-c460-11ee-ab60-98039b0f6c32;
	Mon, 05 Feb 2024 19:56:12 +0000 (UTC)
Received: from osgeo6.osgeo.osuosl.org (localhost [127.0.0.1])
	by lists.osgeo.org (Postfix) with ESMTP id C7DB36142C89;
	Mon,  5 Feb 2024 11:56:09 -0800 (PST)
X-Greylist: delayed 305 seconds by postgrey-1.36 at osgeo6;
 Mon, 05 Feb 2024 11:56:08 PST
Received: from us-smtp-delivery-120.mimecast.com
 (us-smtp-delivery-120.mimecast.com [170.10.129.120])
 by lists.osgeo.org (Postfix) with ESMTPS id 1AF296142C81
 for <tiff@lists.osgeo.org>; Mon,  5 Feb 2024 11:56:08 -0800 (PST)
Received: from BN1PR04CU002.outbound.protection.outlook.com
 (mail-eastus2azlp17012016.outbound.protection.outlook.com [40.93.12.16]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 us-mta-350-uvCW5IJiMzqodsAl48P-uA-1; Mon, 05 Feb 2024 14:49:28 -0500
X-MC-Unique: uvCW5IJiMzqodsAl48P-uA-1
Received: from CO1PR05MB8315.namprd05.prod.outlook.com (2603:10b6:303:fe::14)
 by CO1PR05MB7943.namprd05.prod.outlook.com (2603:10b6:303:db::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.36; Mon, 5 Feb
 2024 19:49:27 +0000
Received: from CO1PR05MB8315.namprd05.prod.outlook.com
 ([fe80::909e:3cfc:c4eb:172f]) by CO1PR05MB8315.namprd05.prod.outlook.com
 ([fe80::909e:3cfc:c4eb:172f%5]) with mapi id 15.20.7249.035; Mon, 5 Feb 2024
 19:49:26 +0000
To: "tiff@lists.osgeo.org" <tiff@lists.osgeo.org>
Thread-Topic: error reading linearRaw subIFD from a TIFF file with libtiff
 built with libjpeg-turbo?
Thread-Index: AQHaWGfS5z40ep01GEe6QfJWYz/tZg==
Date: Mon, 5 Feb 2024 19:49:26 +0000
Message-ID: <CO1PR05MB831576C332EFDBEFA3474D62D3472@CO1PR05MB8315.namprd05.prod.outlook.com>
Accept-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
msip_labels: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: CO1PR05MB8315:EE_|CO1PR05MB7943:EE_
x-ms-office365-filtering-correlation-id: a7794a23-b2a4-4afb-1114-08dc26838f5c
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0
x-microsoft-antispam-message-info:  
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:CO1PR05MB8315.namprd05.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(13230031)(346002)(376002)(136003)(396003)(39860400002)(366004)(230922051799003)(186009)(64100799003)(1800799012)(451199024)(19627405001)(38100700002)(33656002)(7696005)(6506007)(83380400001)(55016003)(122000001)(41300700001)(86362001)(52536014)(8676002)(8936002)(9686003)(71200400001)(2906002)(478600001)(5660300002)(66476007)(64756008)(316002)(66946007)(66556008)(6916009)(76116006)(66446008)(91956017)(38070700009);
 DIR:OUT; SFP:1102
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?bJpefj8uFq12vOAzk7S8tViF1X4ZgZDsnoloVGUymmvigkeO2FXRsuwy?=
 =?Windows-1252?Q?yAGmQsXAuQjW/07dY6ZWlYyXFhDk8Oxer6cm4UfJFy6K5WhlyXGYRHt4?=
 =?Windows-1252?Q?PiF+M2o3EyuvzmPO00ofXQ/tOWa0a95qFpOpZ+RHcsTipXwTopvk09B3?=
 =?Windows-1252?Q?rnhh0Cma6y+/1ANvVFZvTby5K1jaB1yXbstf0AlvmUt6Ak4y+1G2oXhI?=
 =?Windows-1252?Q?c5P8FcupEpro/A0B0DnGzzbHJDP2yI38GEcXjEgEI+op1jEwfjWWkO2t?=
 =?Windows-1252?Q?xP0T9hB+oq6IedD/E21j9y/0DH1J0nqfW5IeDScpZp6wZFYLwWcVX3uk?=
 =?Windows-1252?Q?POwPDqcbjkUovrCp6uZijhjKktt2IAVeWE61p/79SWLhGT9X6KJZtol1?=
 =?Windows-1252?Q?s9a94CS3+ESwyXQa5AwQP1pXUnnfJQdwj9WnVJEQzD9MR1kSQxsqlK+6?=
 =?Windows-1252?Q?FG5/6w9EjsvQktHsxoIyd07Mr0ELMdTNmMiVoHoIFqK4JXQBFSbP/CGr?=
 =?Windows-1252?Q?sx5Gsrja3z6hVkZIqfY8v98mIrxQnwYJQrh5D6+LzdPcCbvcTSZAWoSw?=
 =?Windows-1252?Q?pVQ5tmbVFgwTu4vo9oHBg7gLHJaK56EgeqG0DH45d54MshN4nqvOmM1s?=
 =?Windows-1252?Q?cEw0RN7NHWkC9krWR/AtfgLAN1Zhsacp7d64yKh26vjNgJe+BZwN7Un+?=
 =?Windows-1252?Q?m1dq0kS1TPoCmr2tXh86nUPdh7Dyxni+EywL7/itGxKkRz3mNqMCq0E+?=
 =?Windows-1252?Q?gVUKV9+avExv3OX0XPoH2IgLH36pxNin5m9RPINdjzr0Ygc0YR/m71sc?=
 =?Windows-1252?Q?7cFOj7wep4dIcGekHAuLk87OlOqEhyM8oHcn/+mdSNVofPeRxLs3jn+/?=
 =?Windows-1252?Q?EVAxqn2LY7uUqpz3u6tH0mpMug9siciFjgUSQTOATMpsS7q1kOq2dzQG?=
 =?Windows-1252?Q?jqJLpn9IWki91RgadeBISYg0bHe33lpLocE8Mu6/oSHSI23R2V+zAQoc?=
 =?Windows-1252?Q?UGsc2IQThlbvttPIeAYXdsc8VRr2hfkEReCfqSy4bQW7XQsvEm9LgKbx?=
 =?Windows-1252?Q?vcJaEYN0vF76V/fDBjNi+EdLFxrZkoqYsAALUD4i/tX5WSX2D6AI4t70?=
 =?Windows-1252?Q?j9Gca3p7iuyc0R8r2kRDZ4HI3Cs7znc6qxpNqijk20k0OKpID1FptzWJ?=
 =?Windows-1252?Q?34GEF6QJhF0IIylqXzpBNZN5KQWEr4KmT6bQ93Ar71vcsRRFPUMTnXfn?=
 =?Windows-1252?Q?7dnHYPNxlLKpnchUNnVy8zZrvzp5BK6OowBVf/zR0gwheWDBNfH1HZOv?=
 =?Windows-1252?Q?n/gG9AwsscDIWCzBuhv/eEvM0YS2m2HHYwICWfSzfSjxLnzV/2XW852J?=
 =?Windows-1252?Q?QGwWdwYjUEULLPDnjCBiPfXz3mw5r2uH4e3N83rhfyQ3gBpjU0ByzyyA?=
 =?Windows-1252?Q?OCfIuQbZ/9GDRTqWuq1N46wuMfTGruwCh7KmkTWrt9CckV/dJthQfoI+?=
 =?Windows-1252?Q?XSoe6fjwRb84dKS9IB24b915kSWpuAFuSVSR4Kmz1oddPzwvb0VjjPqE?=
 =?Windows-1252?Q?5of+vcpOrBeUNWGkA/+/nWH2w6/Ls3Bdg29q9NCxz9Kjw7dPe+1KQzNn?=
 =?Windows-1252?Q?LoAl7eDPV8Mj6b0snoJEyBXk9720n2Aegq1w0R1pOWsOLStAUFjtyWCN?=
 =?Windows-1252?Q?7poLHbj9WpRZDGf6YXknmsN6P3zntvAp0FGNRBBXytLRxmOHOoiOFXhI?=
 =?Windows-1252?Q?MCcpUmwsIj0YSbTGblQ5HWBKT0QsEiHjtqV2sFeO?=
MIME-Version: 1.0
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:  
X-OriginatorOrg: mathworks.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: CO1PR05MB8315.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a7794a23-b2a4-4afb-1114-08dc26838f5c
X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Feb 2024 19:49:26.7001 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 99dd3a11-4348-4468-9bdd-e5072b1dc1e6
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 5BMNcSUVkS48u8ChCkEZHN9/0Yts5+CC0vBOdJHltRHQcKGZcBMQkJiyYnNrpqiKr7bB7viYGdn8DdMuv0WPgg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR05MB7943
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: mathworks.com
Content-Language: en-US
Subject: [Tiff] error reading linearRaw subIFD from a TIFF file with libtiff
 built with libjpeg-turbo?
X-BeenThere: tiff@lists.osgeo.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.osgeo.org>
List-Unsubscribe: <https://lists.osgeo.org/mailman/options/tiff>,
 <mailto:tiff-request@lists.osgeo.org?subject=unsubscribe>
List-Post: <mailto:tiff@lists.osgeo.org>
List-Help: <mailto:tiff-request@lists.osgeo.org?subject=help>
List-Subscribe: <https://lists.osgeo.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.osgeo.org?subject=subscribe>
From: Ellen Johnson via Tiff <tiff@lists.osgeo.org>
Reply-To: Ellen Johnson <ellenj@mathworks.com>
Content-Type: multipart/mixed; boundary="===============2496387763764216985=="
Errors-To: tiff-bounces@lists.osgeo.org
Sender: "Tiff" <tiff-bounces@lists.osgeo.org>

--===============2496387763764216985==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_CO1PR05MB831576C332EFDBEFA3474D62D3472CO1PR05MB8315namp_"

--_000_CO1PR05MB831576C332EFDBEFA3474D62D3472CO1PR05MB8315namp_
Content-Type: text/plain; charset=WINDOWS-1252
Content-Transfer-Encoding: quoted-printable

Hi libtiff developers!

   We're now building libtiff v4.6.0 with libjpeg-turbo (instead of libjpeg=
 v6b).

   Many thanks to Bob F. for his previous help with modifying libtiff/confi=
gure to allow us to build with our modified libjpeg-turbo shared library pr=
efix!

   But with our libtiff v4.6.0 built with libjpeg-turbo, I'm now getting an=
 error in our MATLAB imread function when reading a "linearRaw" subImage fr=
om one of our TIFF test files which is a linear DNG file.  This does not er=
ror with libtiff 4.6.0 built with libjpeg v6b.

  I'm not a linearDNG expert, but here's the overview of the file:

  *   The TIFF file has a main image of type TIFF, and two sub images.
  *
The main image is an 8-bit TIFF image with colortype/photometric interpreta=
tion RGB, and is uncompressed.
  *   The first subIFD is a Tiled 16-bit TIFF image with colortype/photomet=
ric interpretation "linearRaw", and is JPEG compressed.
  *   The second subIFD is an 8-bit TIFF image bit with colortype/photometr=
ic interpretration YCbCr and is JPEG compressed.

  Our imread function successfully reads the main image and the second subI=
FD.  But when reading the first subIFD, something goes awry =96 it ends up =
calling libtiff's TIFFReadTile function in tif_read.c, which then calls TIF=
FReadEncodedTile (also in tif_read.c).  I haven't debugged further yet, but=
 something fails during TIFFReadEncodedTile which results in our imread fun=
ction give error that the file has no readable tiles.

  I'm wondering if you know what may be going wrong here, and/or if there a=
re any limitations with libtiff built with libjpeg-turbo that would cause p=
roblems reading a 16-bit linearRaw subIFD that is JPEG compressed.

  Any help would be appreciated.

  Thank you!

     ellen



--_000_CO1PR05MB831576C332EFDBEFA3474D62D3472CO1PR05MB8315namp_
Content-Type: text/html; charset=WINDOWS-1252
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1=
252">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<p class=3D"elementToProof" style=3D"margin-top: 0px; margin-bottom: 0px;">=
<span style=3D"font-family: Calibri, sans-serif; font-size: 11pt; color: rg=
b(36, 36, 36);">Hi libtiff developers!</span></p>
<p class=3D"elementToProof" style=3D"margin-top: 0px; margin-bottom: 0px;">=
<span style=3D"font-family: Calibri, sans-serif; font-size: 11pt; color: rg=
b(36, 36, 36);">&nbsp; &nbsp;We're now building libtiff v4.6.0 with libjpeg=
-turbo (instead of libjpeg v6b).</span></p>
<p class=3D"elementToProof" style=3D"margin-top: 0px; margin-bottom: 0px;">=
<span style=3D"font-family: Calibri, sans-serif; font-size: 11pt; color: rg=
b(36, 36, 36);">&nbsp; &nbsp;Many thanks to Bob F. for his previous help wi=
th modifying libtiff/configure to allow us to build
 with our modified libjpeg-turbo shared library prefix!</span></p>
<p class=3D"elementToProof" style=3D"margin-top: 0px; margin-bottom: 0px;">=
<span style=3D"font-family: Calibri, sans-serif; font-size: 11pt; color: rg=
b(36, 36, 36);">&nbsp; &nbsp;But with our libtiff v4.6.0 built with libjpeg=
-turbo, I'm now getting an error in our MATLAB imread
 function when reading a &quot;linearRaw&quot; subImage from one of our TIF=
F test files which is a linear DNG file.&nbsp; This does not error with lib=
tiff 4.6.0 built with libjpeg v6b.</span></p>
<p class=3D"elementToProof" style=3D"margin-top: 0px; margin-bottom: 0px;">=
<span style=3D"font-family: Calibri, sans-serif; font-size: 11pt; color: rg=
b(36, 36, 36);">&nbsp; I'm not a linearDNG expert, but here's the overview =
of the file:</span></p>
<ul data-editing-info=3D"{&quot;orderedStyleType&quot;:1,&quot;unorderedSty=
leType&quot;:2}" style=3D"margin-block: 0px;">
<li style=3D"font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(=
36, 36, 36); list-style-type: &quot;- &quot;;">
<span style=3D"font-family: Calibri, sans-serif; font-size: 11pt; color: rg=
b(36, 36, 36);">The TIFF file has a main image of type TIFF, and two sub im=
ages.<br>
</span></li><li style=3D"font-family: Calibri, sans-serif; font-size: 11pt;=
 color: rgb(36, 36, 36); list-style-type: &quot;- &quot;;">
<div class=3D"elementToProof"><span style=3D"font-family: Calibri, sans-ser=
if; font-size: 11pt; color: rgb(36, 36, 36);">The main image is an 8-bit TI=
FF image with colortype/photometric interpretation RGB, and is uncompressed=
.</span></div>
</li><li style=3D"font-family: Calibri, sans-serif; font-size: 11pt; color:=
 rgb(36, 36, 36); list-style-type: &quot;- &quot;;">
<span style=3D"font-family: Calibri, sans-serif; font-size: 11pt; color: rg=
b(36, 36, 36);">The first subIFD is a Tiled 16-bit TIFF image with colortyp=
e/photometric interpretation &quot;linearRaw&quot;, and is JPEG compressed.=
<br>
</span></li><li style=3D"font-family: Calibri, sans-serif; font-size: 11pt;=
 color: rgb(36, 36, 36); list-style-type: &quot;- &quot;;">
<span style=3D"font-family: Calibri, sans-serif; font-size: 11pt; color: rg=
b(36, 36, 36);">The second subIFD is an 8-bit TIFF image bit with colortype=
/photometric interpretration YCbCr and is JPEG compressed.<br>
</span></li></ul>
<p class=3D"elementToProof" style=3D"margin-top: 0px; margin-bottom: 0px;">=
<span style=3D"font-family: Calibri, sans-serif; font-size: 11pt; color: rg=
b(36, 36, 36);">&nbsp; Our imread function successfully reads the main imag=
e and the second subIFD.&nbsp; But when reading
 the first subIFD, something goes awry =96 it ends up calling libtiff's TIF=
FReadTile function in tif_read.c, which then calls TIFFReadEncodedTile (als=
o in tif_read.c).&nbsp; I haven't debugged further yet, but something fails=
 during TIFFReadEncodedTile which results
 in our imread function give error that the file has no readable tiles.</sp=
an></p>
<p class=3D"elementToProof" style=3D"margin-top: 0px; margin-bottom: 0px;">=
<span style=3D"font-family: Calibri, sans-serif; font-size: 11pt; color: rg=
b(36, 36, 36);">&nbsp; I'm wondering if you know what may be going wrong he=
re, and/or if there are any limitations with
 libtiff built with libjpeg-turbo that would cause problems reading a 16-bi=
t linearRaw subIFD that is JPEG compressed.</span></p>
<p class=3D"elementToProof" style=3D"margin-top: 0px; margin-bottom: 0px;">=
<span style=3D"font-family: Calibri, sans-serif; font-size: 11pt; color: rg=
b(36, 36, 36);">&nbsp; Any help would be appreciated.&nbsp;</span></p>
<p class=3D"elementToProof" style=3D"margin-top: 0px; margin-bottom: 0px;">=
<span style=3D"font-family: Calibri, sans-serif; font-size: 11pt; color: rg=
b(36, 36, 36);">&nbsp; Thank you!</span></p>
<p class=3D"elementToProof" style=3D"margin-top: 0px; margin-bottom: 0px;">=
<span style=3D"font-family: Calibri, sans-serif; font-size: 11pt; color: rg=
b(36, 36, 36);">&nbsp; &nbsp; &nbsp;ellen</span></p>
<p class=3D"elementToProof" style=3D"margin-top: 0px; margin-bottom: 0px;">=
<span style=3D"font-family: Calibri, sans-serif; font-size: 11pt; color: rg=
b(36, 36, 36);">&nbsp;&nbsp;</span></p>
</body>
</html>

--_000_CO1PR05MB831576C332EFDBEFA3474D62D3472CO1PR05MB8315namp_--


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

_______________________________________________
Tiff mailing list
Tiff@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/tiff

--===============2496387763764216985==--

