commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Damjan Jovanovic (Resolved) (JIRA)" <>
Subject [jira] [Resolved] (SANSELAN-57) Add method to specify metadata (TiffOutputFields) when a new TIFF file is created
Date Thu, 23 Feb 2012 19:28:56 GMT


Damjan Jovanovic resolved SANSELAN-57.

       Resolution: Fixed
    Fix Version/s: 1.0

In commit 1292909 I've added a general API for writing EXIF into images using writeImage().
You populate the parameter map passed to writeImage() with SanselanConstants.PARAM_KEY_EXIF
having a TiffOutputSet as the value, and thus gain the ability to write any field into any
TIFF directory. Thus resolving FIXED.

> Add method to specify metadata (TiffOutputFields) when a new TIFF file is created
> ---------------------------------------------------------------------------------
>                 Key: SANSELAN-57
>                 URL:
>             Project: Commons Sanselan
>          Issue Type: Improvement
>          Components: Format: TIFF
>         Environment: All supported operating systems
>            Reporter: Gary Lucas
>             Fix For: 1.0
>         Attachments: Sanselan-57-TiffMetadataWriter.patch
>   Original Estimate: 1h
>  Remaining Estimate: 1h
> I propose to add a new method to the TiffImageWriterBase class that will simplify the
process of adding metadata tags (any kind, not just the geographic ones) to a TIFF file when
it is created.  I have a version of this class ready for uploading, and will do so in a day
or two if nobody has any suggestions for alternatives.
> The rationale for this new feature grows from a requirement to produce GeoTIFF files.
 GeoTIFF's are a widely supported industry standard that takes advantage of the fact that
TIFF files permit the use of supplemental metadata tags (TIFF's equivalent to EXIF tags).
 The GeoTIFF tags feature metadata that allows the TIFF file to be tied to images of maps,
convert pixels to latitude/longitude coordinates, etc.  
> Although Sanselan does provide an API that allows an application to add such tags to
an existing image (TiffImageWriterLossy), this approach requires writing the TIFF file twice.
 Since some GeoTIFF's can be quite large (50 megs is common), this is a suboptimal approach.
 An API that permits the file to be written just once would be preferred.
> The new method will a variation of writeImage that includes an array list of TiffOutputFields:
>    writeImage(BufferedImage src, OutputStream os, Map params, ArrayList applicationSuppliedFieldList)
> When the initial TIFF file header is created, Sanselan currently adds a "directory" to
the beginning of the file ("directory" is the term used in the TIFF format specification to
mean, simply, a collection of data). This directory provides image metadata such as width,
height, etc.  The new method will add application-supplied output fields to the initial directory.
 This approach will have the advantage that an application will be able to obtain metadata
for a GeoTIFF file without actually reading the full body of the image. It will also permit
the creating of GeoTIFFs consistent with those being produced by the U.S. Geological Survey
and other agencies that provide a complete set of geographic information in the first directory
in the file.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message