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"><<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;">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>
><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>
> 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 <<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>> wrote:<br>
> 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">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>
><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>