<br>Hi Michael,<br><br>I'm browsing through the TIFF code looking<br>for a place where such a callback could be<br>inserted.<br><br>So, far I have not found a clear place where<br>this could be done, but there are many hints<br>
that lead to think that it is indeed possible to<br>do it.<br><br>Let me list what I have found so far, in the <br>hope that other people can follow the trail<br>or find additional hits.<br><br>---<br> <br>Here are some functions and variables in<br>
the TIFF library that seem to be related to<br>a potential management of custom tags:<br><br><br>A) tif->tif_nfields : number of known tags<br><br>if we could insert the id of that custom tag<br>in the structure for which nfields counts,<br>
then it could be accepted during the initial<br>parsing in line 283 of tif_dirread.c<br><br><br><div class="gmail_quote">B) TIFFTagValue: struct in tif_dir.c<br><br> In particular, its appearances in lines<br> 526-543 give us some hope:<br>
<br> namely:<br><br> /*<br> * Grow the custom list if the entry was not found.<br> */<br> if( tv == NULL )<br> {<br> TIFFTagValue *new_customValues;<br> <br>
td->td_customValueCount++;<br> new_customValues = (TIFFTagValue *)<br> _TIFFrealloc(td->td_customValues,<br> sizeof(TIFFTagValue) * td->td_customValueCount);<br> if (!new_customValues) {<br>
TIFFError(module,<br> "%s: Failed to allocate space for list of custom values",<br> tif->tif_name);<br> status = 0;<br> goto end;<br> }<br><br><br>-----<br><br><br>Once we figure out how to do this at the<br>
level of the TIFF library, we will be able<br>to expose that functionality at the level<br>of the TIFFImageIO class.<br><br><br> Regards,<br><br><br> Luis<br><br><br><br>----------------------------------------------------------<br>
On Thu, Sep 30, 2010 at 2:07 PM, Michael Jackson <span dir="ltr"><<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>></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;">
I get the following warning when I open some of my Tiff files:<br>
<br>
TIFFReadDirectory: Warning, 7001.tif: unknown field with tag 34681 (0x8779) encountered.<br>
<br>
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>
<br>
Thanks<br>
___________________________________________________________<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" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software Dayton, Ohio<br>
<br>
<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>
</blockquote></div><br>