commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Damjan Jovanovic <damjan....@gmail.com>
Subject Re: [sanselan] EXIF_TAG_MODIFY_DATE removed from new imaging package?
Date Thu, 26 Apr 2012 12:25:48 GMT
On Thu, Apr 26, 2012 at 2:16 PM, Gary Lucas <gwlucas@sonalysts.com> wrote:
>
> Since we're on the subject, another question.  In encoding data, I was constructing
field types and coding the information.  But it looks like you've got some static declarations
for doing the same thing.  Could you verify that the following is your intended approach
>
>    public TiffOutputField encodeASCII(TagInfo tInfo, String string)
>            throws ImageWriteException,  ImageWriteException
>    {
>        //      previous approach:
>        //        FieldType fType = new FieldTypeAscii(2, "ASCII");
>        //        byte bytes[] = fType.writeData(string, byteOrder);
>
>        byte bytes[] = FieldType.FIELD_TYPE_ASCII.writeData(string, byteOrder);
>
>        TiffOutputField tiffOutputField =
>                new TiffOutputField(
>                tInfo.tag,
>                tInfo,
>                FieldType.FIELD_TYPE_ASCII,
>                bytes.length,
>                bytes);
>        return tiffOutputField;
>    }

Do your emails keep getting cut short?

The easiest way, for a known tag type, is:

tiffOutputDirectory.add(TiffTagConstants.TIFF_TAG_DATE_TIME,
"2012-04-25 01:23:45");

which supports IDE code completion, and automatically overloads to the
correct method based on the tag type.

For an unknown tag type, I think you have to use the old way where you
construct a TiffOutputField yourself.

Damjan

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


Mime
View raw message