< prev index next >
src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFFieldNode.java
Print this page
*** 36,48 ****
/**
* The {@code Node} representation of a {@code TIFFField}
* wherein the child node is procedural rather than buffered.
*/
public class TIFFFieldNode extends IIOMetadataNode {
private static String getNodeName(TIFFField f) {
! return (f.hasDirectory() || f.getData() instanceof TIFFDirectory) ?
! "TIFFIFD" : "TIFFField";
}
private boolean isIFD;
private Boolean isInitialized = Boolean.FALSE;
--- 36,53 ----
/**
* The {@code Node} representation of a {@code TIFFField}
* wherein the child node is procedural rather than buffered.
*/
public class TIFFFieldNode extends IIOMetadataNode {
+ private static boolean isIFD(TIFFField f) {
+ int type = f.getType();
+ return f.hasDirectory() &&
+ (type == TIFFTag.TIFF_LONG || type == TIFFTag.TIFF_IFD_POINTER);
+ }
+
private static String getNodeName(TIFFField f) {
! return isIFD(f) ? "TIFFIFD" : "TIFFField";
}
private boolean isIFD;
private Boolean isInitialized = Boolean.FALSE;
*** 50,61 ****
private TIFFField field;
public TIFFFieldNode(TIFFField field) {
super(getNodeName(field));
! isIFD = field.hasDirectory() ||
! field.getData() instanceof TIFFDirectory;
this.field = field;
TIFFTag tag = field.getTag();
int tagNumber = tag.getNumber();
--- 55,65 ----
private TIFFField field;
public TIFFFieldNode(TIFFField field) {
super(getNodeName(field));
! isIFD = isIFD(field);
this.field = field;
TIFFTag tag = field.getTag();
int tagNumber = tag.getNumber();
< prev index next >