Skip to main content

How do I add private TIFF IFDs and IFD Pointers to TIFF image metadata?

1 reply [Last post]
frederr
Offline
Joined: 2009-10-06

Hi!

I'm working on a project to add private TIFF tags to images. We would like to use a single tag as an IFD Pointer in the

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
frederr
Offline
Joined: 2009-10-06

**
* The class MyParentTIFFTagSet
*/
public class MyParentTIFFTagSet extends TIFFTagSet {

private static MyParentTIFFTagSet theInstance = null;

// 34665 - My IFD Pointer (LONG/1)
/** Tag pointing to the My IFD (type LONG). */
public static final int TAG_MY_IFD_POINTER = 65001;

// To be inserted into parent (root) TIFFTagSet
static class MyIFDPointer extends TIFFTag {

public MyIFDPointer() {
super("MyIFDPointer", TAG_MY_IFD_POINTER, 1 << TIFFTag.TIFF_LONG,
MyTIFFTagSet.getInstance());
}
}

private static List tags;

private static void initTags() {
tags = new ArrayList(1);
tags.add(new MyParentTIFFTagSet.MyIFDPointer());

}

private MyParentTIFFTagSet() {
super(tags);
}

public synchronized static MyParentTIFFTagSet getInstance() {
if (theInstance == null) {
initTags();
theInstance = new MyParentTIFFTagSet();
tags = null;
}
return theInstance;
}
}