Uploaded image for project: 'Commons Imaging'
  1. Commons Imaging
  2. IMAGING-73

Add method to specify metadata (TiffOutputFields) when a new TIFF file is created

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-alpha1
    • Format: TIFF
    • None
    • All supported operating systems

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            gwlucas Gary Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified