Read TIF image properties
How can I read all the properties of TIFF like "SUMMARY", "TITLE" , "AUTHOR" etc.... which are actually seen when you RIGHT CLICK on the image?
Also some of the images have additional custom tab named "imagedetails" which should also be read programmatically.
This custom tab is not normally displayed on right click. It is displayed when I install "eistream" imaging s/w.
I have seen java imaging api's but could not find which tag could read the right click properties of TIFF image.
Please suggest the right API for obtaining the right click properties of TIFF image file.
[608 byte] By [
devdoca] at [2007-11-27 1:29:22]

# 1
Use an ImageReader to get the page metadata.
Set up an ImageReader on your TIFF image (lots of examples out there, please go searching if you don't know how).
Then (where pageNum is the zero-based page number of the image you want metadata from):
IIOMetadata imageMetadata = reader.getImageMetadata(pageNum);
//Get the IFD (Image File Directory) which is the root of all the tags
//for this image. From here we can get all the tags in the image.
TIFFDirectory ifd = TIFFDirectory.createFromMetadata(imageMetadata);
TIFFField[] allFields = ifd.getTIFFFields();
for (int i = 0; i < allFields.length; i++) {
TIFFField field = allFields[i];
String name = field.getTag().getName();
int number = field.getTagNumber();
String type = TIFFField.getTypeName(field.getType());
String value = field.getValueAsString(0);
System.out.println("- " + name + ", " + number + ", " + type + ", " + value);
}
That little chunk of code will output all the registered tiff tags for the image.
CowKing
# 2
I tried with above code following data was obtained,
- NewSubfileType, 254, Long, 0
- ImageWidth, 256, Short, 1711
- ImageLength, 257, Short, 2198
- BitsPerSample, 258, Short, 1
- Compression, 259, Short, 4
- PhotometricInterpretation, 262, Short, 0
- FillOrder, 266, Short, 1
- StripOffsets, 273, Long, 8052
- Orientation, 274, Short, 1
- SamplesPerPixel, 277, Short, 1
- RowsPerStrip, 278, Short, 148
- StripByteCounts, 279, Long, 221
- XResolution, 282, Rational, 200/1
- YResolution, 283, Rational, 200/1
- T6Options, 293, Long, 0
- ResolutionUnit, 296, Short, 2
- Software, 305, Ascii, Oi/GFS, writer v00.07.00
- unknown, 32931, Undefined, 82
- unknown, 32934, Long, 0
I DON'T NEED to acquire the image data.
I need RIGHT CLICK PROPERTIES (SUMMARY,TITLE,KEYWORDS) of whole multi-tiff image. For ex. the general properties that you can find when you right click on any document on windows... ie. word,notepad,or TIFF or JPEG ...etc. Hope this helps..
Can anyone please drive me on this ?