opened
davidOua
username_0
Hi,

I write a TIFF multi image without problem and I can add some metadata as "software" or "data time".

But I can't add Exposure time for example with a same way:
`IIOMetadata metadata = new TIFFImageMetadata(Collections.<Entry>emptySet());

String tiffNativeFormat = TIFFMedataFormat.SUN_NATIVE_IMAGE_METADATA_FORMAT_NAME;
IIOMetadataNode tiffRoot = new IIOMetadataNode(tiffNativeFormat);

IIOMetadataNode tiffIfdNode = new IIOMetadataNode("TIFFIFD");
tiffRoot.appendChild(tiffIfdNode);

createTIFFFieldNode(tiffIfdNode, TIFF.TAG_SOFTWARE, TIFF.TYPE_ASCII, "LFM 1.0");
createTIFFFieldNode(tiffIfdNode, TIFF.TAG_DATE_TIME, TIFF.TYPE_ASCII, strDate);

IIOMetadataNode exifIfdNode = new IIOMetadataNode("TIFFIFD");
exifIfdNode.setAttribute("parentTagNumber", String.valueOf(TIFF.TAG_EXIF_IFD));
tiffIfdNode.appendChild(exifIfdNode);

createTIFFFieldNode(exifIfdNode, EXIF.TAG_DATE_TIME_DIGITIZED, TIFF.TYPE_ASCII, strDate);
createTIFFFieldNode(exifIfdNode, EXIF.TAG_EXPOSURE_TIME, TIFF.TYPE_RATIONAL, ((int)image.getExposureTime()) + "/1000");

metadata.setFromTree(tiffNativeFormat, tiffRoot);`

To try to understand, I add exposure time information with exif tool and after I read the metadata and that's what I tried to do in my code without success.

Where is my mistake?

Best regards.
How to add exposure time into TIFF multi images
issue
created
haraldk
username_1
Hi David,

I think your code is sound.

Unfortunately, only a subset of the TIFF tags are currently copied from the provided metadata into the TIFF structure. These are:

                TIFF.TAG_COMPRESSION * (if compatible, and unless overridden in ImageWriteParam)
                TIFF.TAG_ORIENTATION,
                TIFF.TAG_DATE_TIME,
                TIFF.TAG_DOCUMENT_NAME,
                TIFF.TAG_IMAGE_DESCRIPTION,
                TIFF.TAG_MAKE,
                TIFF.TAG_MODEL,
                TIFF.TAG_PAGE_NAME,
                TIFF.TAG_PAGE_NUMBER,
                TIFF.TAG_ARTIST,
                TIFF.TAG_HOST_COMPUTER,
                TIFF.TAG_COPYRIGHT,
                TIFF.TAG_SOFTWARE *,
                TIFF.TAG_X_RESOLUTION *,
                TIFF.TAG_Y_RESOLUTION *,
                TIFF.TAG_RESOLUTION_UNIT *

*) Will be filled with defaults, if left unspecified. 

If time permits, all metadata specified will make it to the TIFF structure in future, but it's unlikely that it happens before 3.5 (unless someone have some spare time for me).


Best regards,

-- 
Harald K
comment
created
davidOua
username_0
Spare time, maybe not but why give a hand on this problem in particular, why not.

Anyway, thanks for your quick reply.

DO
comment
created
haraldk
username_1
Should be fixed now, as part of #490
comment
closed
haraldk
username_1
issue