Class IptcParser
- java.lang.Object
-
- org.apache.commons.imaging.common.BinaryFileParser
-
- org.apache.commons.imaging.formats.jpeg.iptc.IptcParser
-
public class IptcParser extends BinaryFileParser
-
-
Field Summary
Fields Modifier and Type Field Description private static java.nio.ByteOrderAPP13_BYTE_ORDERprivate static byte[]CHARACTER_ESCAPE_SEQUENCEprivate static java.nio.charset.CharsetDEFAULT_CHARSETprivate static intENV_TAG_CODED_CHARACTER_SETprivate static java.util.logging.LoggerLOGGERprivate static java.util.List<java.lang.Integer>PHOTOSHOP_IGNORED_BLOCK_TYPEBlock types (or Image Resource IDs) that are not recommended to be interpreted when libraries process Photoshop IPTC metadata.
-
Constructor Summary
Constructors Constructor Description IptcParser()Constructs a new instance with the default, big-endian, byte order.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.nio.charset.CharsetfindCharset(byte[] codedCharset)booleanisPhotoshopJpegSegment(byte[] segmentData)protected java.util.List<IptcBlock>parseAllBlocks(byte[] bytes, boolean strict)protected java.util.List<IptcRecord>parseIptcBlock(byte[] bytes)PhotoshopApp13DataparsePhotoshopSegment(byte[] bytes, boolean strict)PhotoshopApp13DataparsePhotoshopSegment(byte[] bytes, ImagingParameters<JpegImagingParameters> params)byte[]writeIptcBlock(java.util.List<IptcRecord> elements)byte[]writeIptcBlock(java.util.List<IptcRecord> elements, boolean forceUtf8Encoding)byte[]writePhotoshopApp13Segment(PhotoshopApp13Data data)-
Methods inherited from class org.apache.commons.imaging.common.BinaryFileParser
debugNumber, debugNumber, getByteOrder, setByteOrder
-
-
-
-
Field Detail
-
LOGGER
private static final java.util.logging.Logger LOGGER
-
APP13_BYTE_ORDER
private static final java.nio.ByteOrder APP13_BYTE_ORDER
-
PHOTOSHOP_IGNORED_BLOCK_TYPE
private static final java.util.List<java.lang.Integer> PHOTOSHOP_IGNORED_BLOCK_TYPE
Block types (or Image Resource IDs) that are not recommended to be interpreted when libraries process Photoshop IPTC metadata.- Since:
- 1.0-alpha2
- See Also:
- Adobe Photoshop File Formats Specification, IMAGING-246
-
DEFAULT_CHARSET
private static final java.nio.charset.Charset DEFAULT_CHARSET
-
ENV_TAG_CODED_CHARACTER_SET
private static final int ENV_TAG_CODED_CHARACTER_SET
- See Also:
- Constant Field Values
-
CHARACTER_ESCAPE_SEQUENCE
private static final byte[] CHARACTER_ESCAPE_SEQUENCE
-
-
Method Detail
-
findCharset
private java.nio.charset.Charset findCharset(byte[] codedCharset)
-
isPhotoshopJpegSegment
public boolean isPhotoshopJpegSegment(byte[] segmentData)
-
parseAllBlocks
protected java.util.List<IptcBlock> parseAllBlocks(byte[] bytes, boolean strict) throws ImagingException, java.io.IOException
- Throws:
ImagingExceptionjava.io.IOException
-
parseIptcBlock
protected java.util.List<IptcRecord> parseIptcBlock(byte[] bytes)
-
parsePhotoshopSegment
public PhotoshopApp13Data parsePhotoshopSegment(byte[] bytes, boolean strict) throws ImagingException, java.io.IOException
- Throws:
ImagingExceptionjava.io.IOException
-
parsePhotoshopSegment
public PhotoshopApp13Data parsePhotoshopSegment(byte[] bytes, ImagingParameters<JpegImagingParameters> params) throws ImagingException, java.io.IOException
- Throws:
ImagingExceptionjava.io.IOException
-
writeIptcBlock
public byte[] writeIptcBlock(java.util.List<IptcRecord> elements) throws ImagingException, java.io.IOException
- Throws:
ImagingExceptionjava.io.IOException
-
writeIptcBlock
public byte[] writeIptcBlock(java.util.List<IptcRecord> elements, boolean forceUtf8Encoding) throws ImagingException, java.io.IOException
- Throws:
ImagingExceptionjava.io.IOException
-
writePhotoshopApp13Segment
public byte[] writePhotoshopApp13Segment(PhotoshopApp13Data data) throws java.io.IOException, ImagingException
- Throws:
java.io.IOExceptionImagingException
-
-