Return-Path: <SRS0=HJ1s=AE=lists.osgeo.org=tiff-bounces@osgeo.org>
Delivered-To: filtered@awaresystems.be
Received: from mx3.pub.mailpod8-cph3.one.com ([10.27.38.13])
	by mailstorage22.cst.mailpod8-cph3.one.com with LMTP
	id 6F+QHYHyN2RpWQAAwT5NuQ
	(envelope-from <SRS0=HJ1s=AE=lists.osgeo.org=tiff-bounces@osgeo.org>)
	for <filtered@awaresystems.be>; Thu, 13 Apr 2023 12:16:01 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=custmx.one.com; s=20201015;
	h=sender:content-type:list-subscribe:list-help:list-post:list-unsubscribe:
	 list-id:subject:mime-version:message-id:date:in-reply-to:references:cc:to:from:
	 x-halone-refid:x-halone-sa:from:x-halone-sa:x-halone-refid;
	bh=r/f4jb21Lm3tHscOZvBcr15RD1Z/9jfRZme/Uxl/+zs=;
	b=jZ5BgDWbv/OsVue8ObOFkd9uP7KNA/W0qYVM1uxuRb1dHnkCzGxsBVp7WSOoSMW4POb/M6JzCD6DQ
	 f6OHeoUGB7ME58o7ovwz+xM1FOc3EAQRDYvPAWjqH6AEGJFca9GNo32HG7bxr4DpcT9k6nih9zqtwl
	 RVi+vwGtelN1Zs5pPKEDmlcA2E7AxR3LAMvIG8NrqXYa4r/kKdjod6TDLfTLKj5Vmko8jvDRecP7El
	 jUmhpnLKtBDSoxEsBg/StCcWmiW4TM1w/z/uKKH8FiN5ry7Mh0XgXeSr+lVFdkv8Wvti4sOQ09K2iQ
	 XfX5+IrAdG0qCdJaRRr9/iHD2RbzLWA==
X-HalOne-SA: -0.6
X-HalOne-RefID: 155866::1681388159-83F0D120-247AB29D/0/0
X-HalOne-ID: f1e167da-d9f4-11ed-9491-98039b062cb2
Received: from lists.osgeo.org (osgeo6.osgeo.osuosl.org [140.211.15.3])
	by mx3.pub.mailpod8-cph3.one.com (Halon) with ESMTPS
	id f1e167da-d9f4-11ed-9491-98039b062cb2;
	Thu, 13 Apr 2023 12:15:58 +0000 (UTC)
Received: from osgeo6.osgeo.osuosl.org (localhost [127.0.0.1])
	by lists.osgeo.org (Postfix) with ESMTP id E7C94612141F;
	Thu, 13 Apr 2023 05:15:54 -0700 (PDT)
Received: from avasout-ptp-004.plus.net (avasout-ptp-004.plus.net
 [84.93.230.250])
 by lists.osgeo.org (Postfix) with ESMTPS id 17CC6612140A
 for <tiff@lists.osgeo.org>; Thu, 13 Apr 2023 05:15:52 -0700 (PDT)
Received: from Apollo ([212.159.61.44]) by smtp with ESMTPA
 id mvrgpVlK2VYiBmvripMVqy; Thu, 13 Apr 2023 13:15:50 +0100
X-Clacks-Overhead: "GNU Terry Pratchett"
X-CM-Score: 0.00
X-CNFS-Analysis: v=2.4 cv=JJMoDuGb c=1 sm=1 tr=0 ts=6437f276
 a=AGp1duJPimIJhwGXxSk9fg==:117 a=AGp1duJPimIJhwGXxSk9fg==:17
 a=DAwyPP_o2Byb1YXLmDAA:9 a=Qs8GJauRAAAA:8 a=fYsLGO92IElYnmEo7_MA:9
 a=CjuIK1q_8ugA:10 a=yMhMjlubAAAA:8 a=SSmOFEACAAAA:8 a=liRZuznRKQBvsc1lut0A:9
 a=C_pEj2No02rlwN4a:21 a=gKO2Hq4RSVkA:10 a=UiCQ7L4-1S4A:10 a=hTZeC7Yk6K0A:10
 a=frz4AuCg-hUA:10 a=-MsOl3yrPmtpHepMbiy1:22
X-AUTH: perdrix52@:2500
From: "David C. Partridge" <david.partridge@perdrix.co.uk>
To: <tiff@lists.osgeo.org>
Cc: "'Robin Glover'" <robin@ghostcat.co.uk>
References: <!&!AAAAAAAAAAAYAAAAAAAAAEUNXr1cc6FEs82BI4LfFJfCgAAAEAAAAM418k/4OelCqjx5kNnQZp4BAAAAAA==@freenet.de>
 <00a001d96d7c$c68c8350$53a589f0$@perdrix.co.uk>
 <000001d96dea$e109f000$a31dd000$@perdrix.co.uk>
In-Reply-To: <000001d96dea$e109f000$a31dd000$@perdrix.co.uk>
Date: Thu, 13 Apr 2023 13:15:48 +0100
Message-ID: <007901d96e01$afd64c60$0f82e520$@perdrix.co.uk>
MIME-Version: 1.0
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQKXQ+zvzFGi/wVMxTKammeNCqpYeAJ5SFMAAkGtBw+th6IxEA==
Content-Language: en-gb
X-CMAE-Envelope: MS4xfLx4v6AxlSrxJtSdtCcBD7M0ppH/XBrQECSdlkE0u5vkHzZsWIdtD/FGCaJk1GU+jkAy4t6ghVYPUO/UwsFEAdOhv+4g+Qo5jhQ37Apk5jy10EH2TAHe
 ahf3Ds5eWfZzQn9gcGjYheb0485kXqD4p4QUZAjAZDx9sB0MB0T92fzpeSnzv6WHc/gAX0fFXxW9Xw==
Subject: Re: [Tiff] TIffWriteDirectory() causes problems
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>
Content-Type: multipart/mixed; boundary="===============2546215896718662716=="
Errors-To: tiff-bounces@lists.osgeo.org
Sender: "Tiff" <tiff-bounces@lists.osgeo.org>

This is a multipart message in MIME format.

--===============2546215896718662716==
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_007A_01D96E0A.119BECE0"
Content-Language: en-gb

This is a multipart message in MIME format.

------=_NextPart_000_007A_01D96E0A.119BECE0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

I eventually worked out what was happening:

The very act of writing the data added two additional fields to the base IFD
- specifically:

 

StripOffsets (3 Long): 514, 16771762, 33543010

StripByteCounts (3 Long): 16771248, 16771248, 2496960 

 

They were added by the libtiff code internally (not by my code).

 

Which meant that the base IFD was larger after writing the data than it was
before. Thus, TIFFWriteDirectory over-wrote the EXIF IFD resulting in the
EXIF IFD being overwritten . and the file therefore failed validation.
Therefore, there's no way to avoid the base IFD being at the end of the
file.

 

From: Tiff <tiff-bounces@lists.osgeo.org> On Behalf Of David C. Partridge
Sent: 13 April 2023 10:33
To: tiff@lists.osgeo.org
Subject: Re: [Tiff] TIffWriteDirectory() causes problems

 

Grump

I changed the code so this is done before I write the image data:

                    //

                    TIFFSetDirectory(m_tiff, 0);

                    TIFFSetField(m_tiff, TIFFTAG_EXIFIFD, dir_offset_EXIF);

                    //TIFFCheckpointDirectory(m_tiff);

                    TIFFWriteDirectory(m_tiff);

                    TIFFSetDirectory(m_tiff, 0);


(is CheckpointDirectory() supposed to have the same effect as WriteDirectory
followed by SetDirectory ???)

But while it solved the issue with scanline size, the main IFD ended up at
the END of the file again:

 

C:\Users\amonra\jhove>jhove "C:\Users\amonra\Documents\Astrophotography\DSS
Test Images\Covington\TestImages\Bias\MasterOffset_ISO200.tif"

Jhove (Rel. 1.26.1, 2022-07-14)

Date: 2023-04-13 10:17:09 BST

RepresentationInformation: C:\Users\amonra\Documents\Astrophotography\DSS
Test Images\Covington\TestImages\Bias\MasterOffset_ISO200.tif

  ReportingModule: TIFF-hul, Rel. 1.9.3 (2022-04-22)

  LastModified: 2023-04-13 06:46:48 BST

  Size: 36040428

  Format: TIFF

  Version: 6.0

  Status: Well-Formed and valid

  SignatureMatches:

   TIFF-hul

  InfoMessage: Unknown TIFF IFD tag: 340

   ID: TIFF-HUL-12

   Offset: 36040184

  InfoMessage: Unknown TIFF IFD tag: 341

   ID: TIFF-HUL-12

   Offset: 36040196

  InfoMessage: Unknown TIFF IFD tag: 50002

   ID: TIFF-HUL-12

   Offset: 36040244

  InfoMessage: Unknown TIFF IFD tag: 50006

   ID: TIFF-HUL-12

   Offset: 36040256

  InfoMessage: Unknown TIFF IFD tag: 50007

   ID: TIFF-HUL-12

   Offset: 36040268

  InfoMessage: Unknown TIFF IFD tag: 50008

   ID: TIFF-HUL-12

   Offset: 36040280

  InfoMessage: Unknown TIFF IFD tag: 50009

   ID: TIFF-HUL-12

   Offset: 36040292

  InfoMessage: Unknown TIFF IFD tag: 50010

   ID: TIFF-HUL-12

   Offset: 36040304

  MIMEtype: image/tiff

  Profile: TIFF/IT-MP (ISO 12639:1998)

  TIFFMetadata:

   ByteOrder: little-endian

   IFDs:

    Number: 2

    IFD:

     Offset: 36039970

     Type: TIFF

     Entries:

      NisoImageMetadata:

etc .

 

I don't (now) issue any TIFF calls from Write() apart from
TIFFScanlineSize(m_tiff) and TIFFWriteEncodedStrip().

 

I tried issuing another TIFFWriteDirectory call just before I called
TIFFClose, just that resulted in a TIFF that I could read in my code without
any issues, but when I tried to validate it using jHove I got:

C:\Users\amonra\jhove>jhove "C:\Users\amonra\Documents\Astrophotography\DSS
Test Images\Covington\TestImages\Bias\MasterOffset_ISO200.tif" | more

Jhove (Rel. 1.26.1, 2022-07-14)

Date: 2023-04-13 10:27:10 BST

RepresentationInformation: C:\Users\amonra\Documents\Astrophotography\DSS
Test Images\Covington\TestImages\Bias\MasterOffset_ISO200.tif

  ReportingModule: BYTESTREAM, Rel. 1.4 (2018-10-01)

  LastModified: 2023-04-13 10:26:44 BST

  Size: 36039970

  Format: bytestream

  Status: Well-Formed and valid

  SignatureMatches:

   TIFF-hul

  MIMEtype: application/octet-stream

 

Or if I specified -m TIFF-hul 

:\Users\amonra\jhove>jhove -m TIFF-hul
"C:\Users\amonra\Documents\Astrophotography\DSS Test
Images\Covington\TestImages\Bias\MasterOffset_ISO200.tif"

| more

hove (Rel. 1.26.1, 2022-07-14)

Date: 2023-04-13 10:30:14 BST

RepresentationInformation: C:\Users\amonra\Documents\Astrophotography\DSS
Test Images\Covington\TestImages\Bias\MasterOffset_ISO200.tif

ReportingModule: TIFF-hul, Rel. 1.9.3 (2022-04-22)

LastModified: 2023-04-13 10:26:44 BST

Size: 36039970

Format: TIFF

Version: 6.0

Status: Not well-formed

SignatureMatches:

  TIFF-hul

InfoMessage: Unknown TIFF IFD tag: 340

  ID: TIFF-HUL-12

  Offset: 222

InfoMessage: Unknown TIFF IFD tag: 341

  ID: TIFF-HUL-12

  Offset: 234

InfoMessage: Unknown TIFF IFD tag: 50002

  ID: TIFF-HUL-12

  Offset: 282

InfoMessage: Unknown TIFF IFD tag: 50006

  ID: TIFF-HUL-12

  Offset: 294

InfoMessage: Unknown TIFF IFD tag: 50007

  ID: TIFF-HUL-12

  Offset: 306

InfoMessage: Unknown TIFF IFD tag: 50008

  ID: TIFF-HUL-12

  Offset: 318

InfoMessage: Unknown TIFF IFD tag: 50009

  ID: TIFF-HUL-12

  Offset: 330

InfoMessage: Unknown TIFF IFD tag: 50010

  ID: TIFF-HUL-12

  Offset: 342

ErrorMessage: Unknown data type: Type = 30068, Tag = 25449

  ID: TIFF-HUL-3

  Offset: 422

ErrorMessage: Unknown data type: Type = 8307, Tag = 25970

  ID: TIFF-HUL-3

  Offset: 434

ErrorMessage: Tag 19752 out of sequence

  ID: TIFF-HUL-2

  Offset: 444

ErrorMessage: Unknown data type: Type = 25701, Tag = 19752

  ID: TIFF-HUL-3

  Offset: 446

ErrorMessage: Unknown data type: Type = 10606, Tag = 24937

  ID: TIFF-HUL-3

  Offset: 458

ErrorMessage: Tag 0 out of sequence

  ID: TIFF-HUL-2

How can I get that root IFD to be at the start of the file please?

 

Thanks, David


------=_NextPart_000_007A_01D96E0A.119BECE0
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 15 =
(filtered medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:"Cascadia Mono";
	panose-1:2 11 6 9 2 0 0 2 0 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	mso-ligatures:standardcontextual;
	mso-fareast-language:EN-US;}
span.EmailStyle19
	{mso-style-type:personal-reply;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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-GB =
link=3D"#0563C1" vlink=3D"#954F72" style=3D'word-wrap:break-word'><div =
class=3DWordSection1><p class=3DMsoNormal>I eventually worked out what =
was happening:<br><br>The very act of writing the data added two =
additional fields to the base IFD - specifically:<o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>StripOffsets =
(3 Long): 514, 16771762, 33543010<o:p></o:p></p><p =
class=3DMsoNormal>StripByteCounts (3 Long): 16771248, 16771248, 2496960 =
<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal>They were added by the libtiff code internally (not by =
my code).<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal>Which meant that the base IFD was larger after writing =
the data than it was before. Thus, TIFFWriteDirectory over-wrote the =
EXIF IFD resulting in the EXIF IFD being overwritten &#8230; and the =
file therefore failed validation.&nbsp;&nbsp; Therefore, there's no way =
to avoid the base IFD being at the end of the file.<o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><div><div =
style=3D'border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm =
0cm 0cm'><p class=3DMsoNormal><b><span lang=3DEN-US =
style=3D'mso-ligatures:none;mso-fareast-language:EN-GB'>From:</span></b><=
span lang=3DEN-US =
style=3D'mso-ligatures:none;mso-fareast-language:EN-GB'> Tiff =
&lt;tiff-bounces@lists.osgeo.org&gt; <b>On Behalf Of </b>David C. =
Partridge<br><b>Sent:</b> 13 April 2023 10:33<br><b>To:</b> =
tiff@lists.osgeo.org<br><b>Subject:</b> Re: [Tiff] TIffWriteDirectory() =
causes problems<o:p></o:p></span></p></div></div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal =
style=3D'text-autospace:none'>Grump<br><br>I changed the code so this is =
done before I write the image data:<br><br><span =
style=3D'font-size:9.5pt;font-family:"Cascadia =
Mono";color:black;mso-ligatures:none;mso-fareast-language:EN-GB'>&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span =
style=3D'font-size:9.5pt;font-family:"Cascadia =
Mono";color:green;mso-ligatures:none;mso-fareast-language:EN-GB'>//</span=
><span style=3D'font-size:9.5pt;font-family:"Cascadia =
Mono";color:black;mso-ligatures:none;mso-fareast-language:EN-GB'><o:p></o=
:p></span></p><p class=3DMsoNormal style=3D'text-autospace:none'><span =
style=3D'font-size:9.5pt;font-family:"Cascadia =
Mono";color:black;mso-ligatures:none;mso-fareast-language:EN-GB'>&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TIFFSetDirectory(m_tiff, =
0);<o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'text-autospace:none'><span =
style=3D'font-size:9.5pt;font-family:"Cascadia =
Mono";color:black;mso-ligatures:none;mso-fareast-language:EN-GB'>&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TIFFSetField(m_tiff, </span><span =
style=3D'font-size:9.5pt;font-family:"Cascadia =
Mono";color:#6F008A;mso-ligatures:none;mso-fareast-language:EN-GB'>TIFFTA=
G_EXIFIFD</span><span style=3D'font-size:9.5pt;font-family:"Cascadia =
Mono";color:black;mso-ligatures:none;mso-fareast-language:EN-GB'>, =
dir_offset_EXIF);<o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'text-autospace:none'><span =
style=3D'font-size:9.5pt;font-family:"Cascadia =
Mono";color:black;mso-ligatures:none;mso-fareast-language:EN-GB'>&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span =
style=3D'font-size:9.5pt;font-family:"Cascadia =
Mono";color:green;mso-ligatures:none;mso-fareast-language:EN-GB'>//TIFFCh=
eckpointDirectory(m_tiff);</span><span =
style=3D'font-size:9.5pt;font-family:"Cascadia =
Mono";color:black;mso-ligatures:none;mso-fareast-language:EN-GB'><o:p></o=
:p></span></p><p class=3DMsoNormal style=3D'text-autospace:none'><span =
style=3D'font-size:9.5pt;font-family:"Cascadia =
Mono";color:black;mso-ligatures:none;mso-fareast-language:EN-GB'>&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
TIFFWriteDirectory(m_tiff);<o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'text-autospace:none'><span =
style=3D'font-size:9.5pt;font-family:"Cascadia =
Mono";color:black;mso-ligatures:none;mso-fareast-language:EN-GB'>&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TIFFSetDirectory(m_tiff, =
0);<o:p></o:p></span></p><p class=3DMsoNormal><br>(is =
CheckpointDirectory() supposed to have the same effect as WriteDirectory =
followed by SetDirectory ???)<br><br>But while it solved the issue with =
scanline size, the main IFD ended up at the END of the file =
again:<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal>C:\Users\amonra\jhove&gt;jhove =
&quot;C:\Users\amonra\Documents\Astrophotography\DSS Test =
Images\Covington\TestImages\Bias\MasterOffset_ISO200.tif&quot;<o:p></o:p>=
</p><p class=3DMsoNormal>Jhove (Rel. 1.26.1, =
2022-07-14)<o:p></o:p></p><p class=3DMsoNormal>Date: 2023-04-13 10:17:09 =
BST<o:p></o:p></p><p class=3DMsoNormal>RepresentationInformation: =
C:\Users\amonra\Documents\Astrophotography\DSS Test =
Images\Covington\TestImages\Bias\MasterOffset_ISO200.tif<o:p></o:p></p><p=
 class=3DMsoNormal>&nbsp; ReportingModule: TIFF-hul, Rel. 1.9.3 =
(2022-04-22)<o:p></o:p></p><p class=3DMsoNormal>&nbsp; LastModified: =
2023-04-13 06:46:48 BST<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Size: =
36040428<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Format: =
TIFF<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Version: =
6.0<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Status: Well-Formed and =
valid<o:p></o:p></p><p class=3DMsoNormal>&nbsp; =
SignatureMatches:<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; =
TIFF-hul<o:p></o:p></p><p class=3DMsoNormal>&nbsp; InfoMessage: Unknown =
TIFF IFD tag: 340<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; ID: =
TIFF-HUL-12<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; Offset: =
36040184<o:p></o:p></p><p class=3DMsoNormal>&nbsp; InfoMessage: Unknown =
TIFF IFD tag: 341<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; ID: =
TIFF-HUL-12<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; Offset: =
36040196<o:p></o:p></p><p class=3DMsoNormal>&nbsp; InfoMessage: Unknown =
TIFF IFD tag: 50002<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; ID: =
TIFF-HUL-12<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; Offset: =
36040244<o:p></o:p></p><p class=3DMsoNormal>&nbsp; InfoMessage: Unknown =
TIFF IFD tag: 50006<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; ID: =
TIFF-HUL-12<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; Offset: =
36040256<o:p></o:p></p><p class=3DMsoNormal>&nbsp; InfoMessage: Unknown =
TIFF IFD tag: 50007<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; ID: =
TIFF-HUL-12<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; Offset: =
36040268<o:p></o:p></p><p class=3DMsoNormal>&nbsp; InfoMessage: Unknown =
TIFF IFD tag: 50008<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; ID: =
TIFF-HUL-12<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; Offset: =
36040280<o:p></o:p></p><p class=3DMsoNormal>&nbsp; InfoMessage: Unknown =
TIFF IFD tag: 50009<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; ID: =
TIFF-HUL-12<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; Offset: =
36040292<o:p></o:p></p><p class=3DMsoNormal>&nbsp; InfoMessage: Unknown =
TIFF IFD tag: 50010<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; ID: =
TIFF-HUL-12<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; Offset: =
36040304<o:p></o:p></p><p class=3DMsoNormal>&nbsp; MIMEtype: =
image/tiff<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Profile: TIFF/IT-MP =
(ISO 12639:1998)<o:p></o:p></p><p class=3DMsoNormal>&nbsp; =
TIFFMetadata:<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; ByteOrder: =
little-endian<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; =
IFDs:<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp;&nbsp; Number: =
2<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp;&nbsp; =
IFD:<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp;&nbsp;&nbsp; Offset: =
36039970<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp;&nbsp;&nbsp; =
Type: TIFF<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp;&nbsp;&nbsp; =
Entries:<o:p></o:p></p><p =
class=3DMsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
NisoImageMetadata:<br><br>etc &#8230;<o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>I =
don&#8217;t (now) issue any TIFF calls from Write() apart from <span =
style=3D'font-size:9.5pt;font-family:"Cascadia =
Mono";color:black;mso-ligatures:none;mso-fareast-language:EN-GB'>TIFFScan=
lineSize(m_tiff) and TIFFWriteEncodedStrip().</span><o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>I tried =
issuing another TIFFWriteDirectory call just before I called TIFFClose, =
just that resulted in a TIFF that I could read in my code without any =
issues, but when I tried to validate it using jHove I =
got:<br><br>C:\Users\amonra\jhove&gt;jhove =
&quot;C:\Users\amonra\Documents\Astrophotography\DSS Test =
Images\Covington\TestImages\Bias\MasterOffset_ISO200.tif&quot; | =
more<o:p></o:p></p><p class=3DMsoNormal>Jhove (Rel. 1.26.1, =
2022-07-14)<o:p></o:p></p><p class=3DMsoNormal>Date: 2023-04-13 10:27:10 =
BST<o:p></o:p></p><p class=3DMsoNormal>RepresentationInformation: =
C:\Users\amonra\Documents\Astrophotography\DSS Test =
Images\Covington\TestImages\Bias\MasterOffset_ISO200.tif<o:p></o:p></p><p=
 class=3DMsoNormal>&nbsp; ReportingModule: BYTESTREAM, Rel. 1.4 =
(2018-10-01)<o:p></o:p></p><p class=3DMsoNormal>&nbsp; LastModified: =
2023-04-13 10:26:44 BST<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Size: =
36039970<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Format: =
bytestream<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Status: Well-Formed =
and valid<o:p></o:p></p><p class=3DMsoNormal>&nbsp; =
SignatureMatches:<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp; =
TIFF-hul<o:p></o:p></p><p class=3DMsoNormal>&nbsp; MIMEtype: =
application/octet-stream<o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>Or if I =
specified -m TIFF-hul <br><br>:\Users\amonra\jhove&gt;jhove -m TIFF-hul =
&quot;C:\Users\amonra\Documents\Astrophotography\DSS Test =
Images\Covington\TestImages\Bias\MasterOffset_ISO200.tif&quot;<o:p></o:p>=
</p><p class=3DMsoNormal>| more<o:p></o:p></p><p class=3DMsoNormal>hove =
(Rel. 1.26.1, 2022-07-14)<o:p></o:p></p><p class=3DMsoNormal>Date: =
2023-04-13 10:30:14 BST<o:p></o:p></p><p =
class=3DMsoNormal>RepresentationInformation: =
C:\Users\amonra\Documents\Astrophotography\DSS Test =
Images\Covington\TestImages\Bias\MasterOffset_ISO200.tif<o:p></o:p></p><p=
 class=3DMsoNormal>ReportingModule: TIFF-hul, Rel. 1.9.3 =
(2022-04-22)<o:p></o:p></p><p class=3DMsoNormal>LastModified: 2023-04-13 =
10:26:44 BST<o:p></o:p></p><p class=3DMsoNormal>Size: =
36039970<o:p></o:p></p><p class=3DMsoNormal>Format: =
TIFF<o:p></o:p></p><p class=3DMsoNormal>Version: 6.0<o:p></o:p></p><p =
class=3DMsoNormal>Status: Not well-formed<o:p></o:p></p><p =
class=3DMsoNormal>SignatureMatches:<o:p></o:p></p><p =
class=3DMsoNormal>&nbsp; TIFF-hul<o:p></o:p></p><p =
class=3DMsoNormal>InfoMessage: Unknown TIFF IFD tag: =
340<o:p></o:p></p><p class=3DMsoNormal>&nbsp; ID: =
TIFF-HUL-12<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Offset: =
222<o:p></o:p></p><p class=3DMsoNormal>InfoMessage: Unknown TIFF IFD =
tag: 341<o:p></o:p></p><p class=3DMsoNormal>&nbsp; ID: =
TIFF-HUL-12<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Offset: =
234<o:p></o:p></p><p class=3DMsoNormal>InfoMessage: Unknown TIFF IFD =
tag: 50002<o:p></o:p></p><p class=3DMsoNormal>&nbsp; ID: =
TIFF-HUL-12<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Offset: =
282<o:p></o:p></p><p class=3DMsoNormal>InfoMessage: Unknown TIFF IFD =
tag: 50006<o:p></o:p></p><p class=3DMsoNormal>&nbsp; ID: =
TIFF-HUL-12<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Offset: =
294<o:p></o:p></p><p class=3DMsoNormal>InfoMessage: Unknown TIFF IFD =
tag: 50007<o:p></o:p></p><p class=3DMsoNormal>&nbsp; ID: =
TIFF-HUL-12<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Offset: =
306<o:p></o:p></p><p class=3DMsoNormal>InfoMessage: Unknown TIFF IFD =
tag: 50008<o:p></o:p></p><p class=3DMsoNormal>&nbsp; ID: =
TIFF-HUL-12<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Offset: =
318<o:p></o:p></p><p class=3DMsoNormal>InfoMessage: Unknown TIFF IFD =
tag: 50009<o:p></o:p></p><p class=3DMsoNormal>&nbsp; ID: =
TIFF-HUL-12<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Offset: =
330<o:p></o:p></p><p class=3DMsoNormal>InfoMessage: Unknown TIFF IFD =
tag: 50010<o:p></o:p></p><p class=3DMsoNormal>&nbsp; ID: =
TIFF-HUL-12<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Offset: =
342<o:p></o:p></p><p class=3DMsoNormal>ErrorMessage: Unknown data type: =
Type =3D 30068, Tag =3D 25449<o:p></o:p></p><p class=3DMsoNormal>&nbsp; =
ID: TIFF-HUL-3<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Offset: =
422<o:p></o:p></p><p class=3DMsoNormal>ErrorMessage: Unknown data type: =
Type =3D 8307, Tag =3D 25970<o:p></o:p></p><p class=3DMsoNormal>&nbsp; =
ID: TIFF-HUL-3<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Offset: =
434<o:p></o:p></p><p class=3DMsoNormal>ErrorMessage: Tag 19752 out of =
sequence<o:p></o:p></p><p class=3DMsoNormal>&nbsp; ID: =
TIFF-HUL-2<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Offset: =
444<o:p></o:p></p><p class=3DMsoNormal>ErrorMessage: Unknown data type: =
Type =3D 25701, Tag =3D 19752<o:p></o:p></p><p class=3DMsoNormal>&nbsp; =
ID: TIFF-HUL-3<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Offset: =
446<o:p></o:p></p><p class=3DMsoNormal>ErrorMessage: Unknown data type: =
Type =3D 10606, Tag =3D 24937<o:p></o:p></p><p class=3DMsoNormal>&nbsp; =
ID: TIFF-HUL-3<o:p></o:p></p><p class=3DMsoNormal>&nbsp; Offset: =
458<o:p></o:p></p><p class=3DMsoNormal>ErrorMessage: Tag 0 out of =
sequence<o:p></o:p></p><p class=3DMsoNormal>&nbsp; ID: =
TIFF-HUL-2<br><br>How can I get that root IFD to be at the start of the =
file please?<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal>Thanks, David<span =
style=3D'color:#1F497D'><o:p></o:p></span></p></div></body></html>
------=_NextPart_000_007A_01D96E0A.119BECE0--


--===============2546215896718662716==
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

--===============2546215896718662716==--

