On Thu, Apr 26, 2012 at 2:16 PM, Gary Lucas <gwlu...@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-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org