- *va_arg(ap, uint32*) = td->td_richtiffiptcLength;
- *va_arg(ap, void**) = td->td_richtiffiptcData;
- break;
-#endif
- default:
- /*
- * This can happen if multiple images are open with
- * different codecs which have private tags. The
- * global tag information table may then have tags
- * that are valid for one file but not the other.
- * If the client tries to get a tag that is not valid
- * for the image's codec then we'll arrive here.
- */
- TIFFError("TIFFGetField",
- "%s: Invalid %stag \"%s\" (not supported by codec)",
- tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "",
- _TIFFFieldWithTag(tif, tag)->field_name);
- break;
- }
- return (1);
+ *va_arg(ap, uint32*) = td->td_richtiffiptcLength;
+ *va_arg(ap, void**) = td->td_richtiffiptcData;
+ break;
+ case TIFFTAG_XMLPACKET:
+ *va_arg(ap, uint32*) = td->td_xmlpacketLength;
+ *va_arg(ap, void**) = td->td_xmlpacketData;
+ break;
+ /* Begin Pixar Tags */
+ case TIFFTAG_PIXAR_IMAGEFULLWIDTH:
+ *va_arg(ap, uint32*) = td->td_imagefullwidth;
+ break;
+ case TIFFTAG_PIXAR_IMAGEFULLLENGTH:
+ *va_arg(ap, uint32*) = td->td_imagefulllength;
+ break;
+ case TIFFTAG_PIXAR_TEXTUREFORMAT:
+ *va_arg(ap, char**) = td->td_textureformat;
+ break;
+ case TIFFTAG_PIXAR_WRAPMODES:
+ *va_arg(ap, char**) = td->td_wrapmodes;
+ break;
+ case TIFFTAG_PIXAR_FOVCOT:
+ *va_arg(ap, float*) = td->td_fovcot;
+ break;
+ case TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN:
+ *va_arg(ap, float**) = td->td_matrixWorldToScreen;
+ break;
+ case TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA:
+ *va_arg(ap, float**) = td->td_matrixWorldToCamera;
+ break;
+ /* End Pixar Tags */
+
+ default:
+ {
+ const TIFFFieldInfo* fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY);
+ int i;
+
+ /*
+ * This can happen if multiple images are open with
+ * different codecs which have private tags. The
+ * global tag information table may then have tags
+ * that are valid for one file but not the other.
+ * If the client tries to get a tag that is not valid
+ * for the image's codec then we'll arrive here.
+ */
+ if( fip == NULL || fip->field_bit != FIELD_CUSTOM )
+ {
+ TIFFError("_TIFFVGetField",
+ "%s: Invalid %stag \"%s\" (not supported by codec)",
+ tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "",
+ _TIFFFieldWithTag(tif, tag)->field_name);
+ ret_val = 0;
+ break;
+ }
+
+ /*
+ ** Do we have a custom value?
+ */
+ ret_val = 0;
+ for( i = 0; i < td->td_customValueCount; i++ )
+ {
+ TIFFTagValue *tv = td->td_customValues + i;
+
+ if( tv->info->field_tag != tag )
+ continue;
+
+ if( fip->field_passcount )
+ {
+ *va_arg(ap, u_short *) = (u_short) tv->count;
+ *va_arg(ap, void **) = tv->value;
+ ret_val = 1;
+ break;
+ }
+ else if( fip->field_type == TIFF_ASCII )
+ {
+ *va_arg(ap, void **) = tv->value;
+ ret_val = 1;
+ break;
+ }
+ else
+ {
+ printf( "TIFFVGetField ... pass by value not imp.\n" );
+ break;
+ }
+ }
+ }
+ }
+ return( ret_val );