Hi Michael,<br><br>Yeap, you got it.<br><br>      Google beats grep...      :-(<br><br>---<br><br>This page looks detailed enough for us <br>to be able to expose the functionality at <br>the level of TIFFImageIO.<br><br>Would it interest you to give it a shot<br>
at implementing this in TIFFImageIO ?<br><br>We are about to move the TIFF 4.0<br>branch into master (early next week),<br>so, once the new version is in, it could<br>be a good time for adding this feature.<br><br><br>      Regards,<br>
<br><br>             Luis<br><br><br><br>------------------------------------------------------<br><div class="gmail_quote">On Sun, Oct 17, 2010 at 9:45 AM, Michael Jackson <span dir="ltr">&lt;<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Taking that information and looking around some more on the internet I came across this page:<br>

<br>
<a href="http://www.remotesensing.org/libtiff/addingtags.html" target="_blank">http://www.remotesensing.org/libtiff/addingtags.html</a><br>
<br>
Which on a cursory glance may be what is needed to figure out how to add a custom tag to be read.<br>
<div class="im">___________________________________________________________<br>
Mike Jackson                      <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer       <a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software               Dayton, Ohio<br>
<br>
</div><div><div></div><div class="h5">On Oct 17, 2010, at 9:16 AM, Luis Ibanez wrote:<br>
<br>
&gt;<br>
&gt; Hi Michael,<br>
&gt;<br>
&gt; I&#39;m browsing through the TIFF code looking<br>
&gt; for a place where such a callback could be<br>
&gt; inserted.<br>
&gt;<br>
&gt; So, far I have not found a clear place where<br>
&gt; this could be done, but there are many hints<br>
&gt; that lead to think that it is indeed possible to<br>
&gt; do it.<br>
&gt;<br>
&gt; Let me list what I have found so far, in the<br>
&gt; hope that other people can follow the trail<br>
&gt; or find additional hits.<br>
&gt;<br>
&gt; ---<br>
&gt;<br>
&gt; Here are some functions and variables in<br>
&gt; the TIFF library that seem to be related to<br>
&gt; a potential management of custom tags:<br>
&gt;<br>
&gt;<br>
&gt; A) tif-&gt;tif_nfields :  number of known tags<br>
&gt;<br>
&gt; if we could insert the id of that custom tag<br>
&gt; in the structure for which nfields counts,<br>
&gt; then it could be accepted during the initial<br>
&gt; parsing in line 283 of tif_dirread.c<br>
&gt;<br>
&gt;<br>
&gt; B) TIFFTagValue: struct in tif_dir.c<br>
&gt;<br>
&gt;    In particular, its appearances in lines<br>
&gt;    526-543 give us some hope:<br>
&gt;<br>
&gt;    namely:<br>
&gt;<br>
&gt;              /*<br>
&gt;              * Grow the custom list if the entry was not found.<br>
&gt;              */<br>
&gt;             if( tv == NULL )<br>
&gt;             {<br>
&gt;     TIFFTagValue  *new_customValues;<br>
&gt;<br>
&gt;     td-&gt;td_customValueCount++;<br>
&gt;     new_customValues = (TIFFTagValue *)<br>
&gt;       _TIFFrealloc(td-&gt;td_customValues,<br>
&gt;              sizeof(TIFFTagValue) * td-&gt;td_customValueCount);<br>
&gt;     if (!new_customValues) {<br>
&gt;       TIFFError(module,<br>
&gt;     &quot;%s: Failed to allocate space for list of custom values&quot;,<br>
&gt;           tif-&gt;tif_name);<br>
&gt;       status = 0;<br>
&gt;       goto end;<br>
&gt;     }<br>
&gt;<br>
&gt;<br>
&gt; -----<br>
&gt;<br>
&gt;<br>
&gt; Once we figure out how to do this at the<br>
&gt; level of the TIFF library, we will be able<br>
&gt; to expose that functionality at the level<br>
&gt; of the TIFFImageIO class.<br>
&gt;<br>
&gt;<br>
&gt;     Regards,<br>
&gt;<br>
&gt;<br>
&gt;           Luis<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; ----------------------------------------------------------<br>
&gt; On Thu, Sep 30, 2010 at 2:07 PM, Michael Jackson &lt;<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>&gt; wrote:<br>
&gt; I get the following warning when I open some of my Tiff files:<br>
&gt;<br>
&gt; TIFFReadDirectory: Warning, 7001.tif: unknown field with tag 34681 (0x8779) encountered.<br>
&gt;<br>
&gt; I know what the field is and I know how to parse it. Are there any facilities for setting a callback function or anything like that to the Tiff file reader?<br>
&gt;<br>
&gt; Thanks<br>
&gt; ___________________________________________________________<br>
&gt; Mike Jackson                      <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
&gt; Principal Software Engineer       <a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a><br>
&gt; BlueQuartz Software               Dayton, Ohio<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _____________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Kitware offers ITK Training Courses, for more information visit:<br>
&gt; <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
&gt;<br>
<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br>