Excellent idea.  Thanks.

Our application uses a modified version of Sanselan that includes my 
performance enhancements.  I've started swapping that out with the latest from 
Apache Imaging, again with my latest two patches for speed improvements.   On 
the read side, it went very quickly.   On the write side, I'm still trying to 
get things working. Although the API is definitely a lot cleaner than the 
original, I'm not sure I've figured it out yet.

Here's a snippet of code I'm using to write a GeoTIFF file.   Would you take a 
look and make sure I am doing the right thing (particularly in the constructor 
for the TiffOutputDirectory)?  The fieldList is a set of output fields that 
were populated by a utility routine.   That approach is a hold-over from the 
Sanselan implementation (is there a better way to do it?).   I add them to an 
output directory, bundle the directory in an output set, and pass the output 
set into the lossy writer as a parameter.




        HashMap<String, Object> params = new HashMap<String, Object>();

        // set optional parameters if you like
        params.put(ImagingConstants.PARAM_KEY_COMPRESSION,
                new Integer(TiffConstants.TIFF_COMPRESSION_UNCOMPRESSED));


        // tiffByteOrder set as appropriate for system
        // fieldList is an array list of TiffOutputFields that 
        //   was set by a utility class.
        TiffImageWriterLossy lWriter =
                new TiffImageWriterLossy(tiffByteOrder);

        TiffOutputDirectory tiffDirectory = new TiffOutputDirectory(
                TiffDirectoryConstants.DIRECTORY_TYPE_DIR_0, tiffByteOrder);
        for (TiffOutputField field : fieldList) {
            tiffDirectory.add(field);
        }

        TiffOutputSet tiffOutputSet = new TiffOutputSet();
        tiffOutputSet.addDirectory(tiffDirectory);
        params.put(ImagingConstants.PARAM_KEY_EXIF, tiffOutputSet);

        FileOutputStream fos = new FileOutputStream(outputFile);
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        lWriter.writeImage(outputImage, bos, params);
        bos.flush();
        bos.close();
        fos.close();




One question.  When I 
-----Original Message-----
From: Damjan Jovanovic [mailto:damjan....@gmail.com] 
Sent: Thursday, April 26, 2012 12:02 AM
To: Commons Developers List
Subject: Re: [sanselan] EXIF_TAG_MODIFY_DATE removed from new imaging package?

On Wed, Apr 25, 2012 at 10:30 PM, Gary Lucas <gwlu...@sonalysts.com> wrote:
> I'm taking a stab at transitioning from Sanselan to the new Apache Imaging.   
> One thing I've noticed is that one of the EXIF tags my existing software uses 
> seems to have been removed from imaging:
>
>  public static final TagInfo EXIF_TAG_MODIFY_DATE = new TagInfo(
>            "Modify Date", 0x0132, FIELD_TYPE_ASCII, 1, 
> EXIF_DIRECTORY_IFD0);
>
>
> I'm not familiar with the details behind this tag.   Was it removed because 
> it is obsolete or non-standard?    An oversight?
>
> Thanks.
>
> Gary

One of the recent changes was deduplication of TIFF tags, and grouping of tags 
by specification.

Tag 0x0132 is defined in the TIFF6 specification, so it is now under 
TiffTagConstants, and known as TIFF_TAG_DATE_TIME.

Also I am considering replacing the EXIF_ prefix with TIFF_ for all tags.

Damjan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to