Class JpegXmpRewriter
java.lang.Object
org.apache.commons.imaging.common.BinaryFileParser
org.apache.commons.imaging.formats.jpeg.xmp.JpegRewriter
org.apache.commons.imaging.formats.jpeg.xmp.JpegXmpRewriter
Interface for Exif write/update/remove functionality for Jpeg/JFIF images.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.commons.imaging.formats.jpeg.xmp.JpegRewriterJpegRewriter.JFIFPiece, JpegRewriter.JFIFPieces, JpegRewriter.JFIFPieceSegment
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a new instance with the default, big-endian, byte order.
- 
Method SummaryModifier and TypeMethodDescriptionvoidremoveXmpXml(byte[] src, OutputStream os) Reads a JPEG image, removes all XMP XML (by removing the APP1 segment), and writes the result to a stream.voidremoveXmpXml(File src, OutputStream os) Reads a JPEG image, removes all XMP XML (by removing the APP1 segment), and writes the result to a stream.voidremoveXmpXml(InputStream src, OutputStream os) Reads a JPEG image, removes all XMP XML (by removing the APP1 segment), and writes the result to a stream.voidremoveXmpXml(ByteSource byteSource, OutputStream os) Reads a JPEG image, removes all XMP XML (by removing the APP1 segment), and writes the result to a stream.voidupdateXmpXml(byte[] src, OutputStream os, String xmpXml) Reads a JPEG image, replaces the XMP XML and writes the result to a stream.voidupdateXmpXml(File src, OutputStream os, String xmpXml) Reads a JPEG image, replaces the XMP XML and writes the result to a stream.voidupdateXmpXml(InputStream src, OutputStream os, String xmpXml) Reads a JPEG image, replaces the XMP XML and writes the result to a stream.voidupdateXmpXml(ByteSource byteSource, OutputStream os, String xmpXml) Reads a JPEG image, replaces the XMP XML and writes the result to a stream.Methods inherited from class org.apache.commons.imaging.formats.jpeg.xmp.JpegRewriteranalyzeJfif, filterSegments, filterSegments, findPhotoshopApp13Segments, insertAfterLastAppSegments, insertBeforeFirstAppSegments, removeExifSegments, removePhotoshopApp13Segments, removeXmpSegments, writeSegmentsMethods inherited from class org.apache.commons.imaging.common.BinaryFileParserdebugNumber, debugNumber, getByteOrder, setByteOrder
- 
Constructor Details- 
JpegXmpRewriterpublic JpegXmpRewriter()Constructs a new instance with the default, big-endian, byte order.
 
- 
- 
Method Details- 
removeXmpXmlReads a JPEG image, removes all XMP XML (by removing the APP1 segment), and writes the result to a stream.- Parameters:
- src- Byte array containing JPEG image data.
- os- OutputStream to write the image to.
- Throws:
- ImagingException- if it fails to read the JFIF segments
- IOException- if it fails to read or write the data from the segments
 
- 
removeXmpXmlpublic void removeXmpXml(ByteSource byteSource, OutputStream os) throws ImagingException, IOException Reads a JPEG image, removes all XMP XML (by removing the APP1 segment), and writes the result to a stream.- Parameters:
- byteSource- ByteSource containing JPEG image data.
- os- OutputStream to write the image to.
- Throws:
- ImagingException- if it fails to read the JFIF segments
- IOException- if it fails to read or write the data from the segments
 
- 
removeXmpXmlReads a JPEG image, removes all XMP XML (by removing the APP1 segment), and writes the result to a stream.- Parameters:
- src- Image file.
- os- OutputStream to write the image to.
- Throws:
- ImagingException- if it fails to read the JFIF segments
- IOException- if it fails to read or write the data from the segments
- See Also:
 
- 
removeXmpXmlReads a JPEG image, removes all XMP XML (by removing the APP1 segment), and writes the result to a stream.- Parameters:
- src- InputStream containing JPEG image data.
- os- OutputStream to write the image to.
- Throws:
- ImagingException- if it fails to read the JFIF segments
- IOException- if it fails to read or write the data from the segments
 
- 
updateXmpXmlpublic void updateXmpXml(byte[] src, OutputStream os, String xmpXml) throws ImagingException, IOException Reads a JPEG image, replaces the XMP XML and writes the result to a stream.- Parameters:
- src- Byte array containing JPEG image data.
- os- OutputStream to write the image to.
- xmpXml- String containing XMP XML.
- Throws:
- ImagingException- if it fails to read or write the JFIF segments
- IOException- if it fails to read or write the data from the segments
 
- 
updateXmpXmlpublic void updateXmpXml(ByteSource byteSource, OutputStream os, String xmpXml) throws ImagingException, IOException Reads a JPEG image, replaces the XMP XML and writes the result to a stream.- Parameters:
- byteSource- ByteSource containing JPEG image data.
- os- OutputStream to write the image to.
- xmpXml- String containing XMP XML.
- Throws:
- ImagingException- if it fails to read or write the JFIF segments
- IOException- if it fails to read or write the data from the segments
 
- 
updateXmpXmlpublic void updateXmpXml(File src, OutputStream os, String xmpXml) throws ImagingException, IOException Reads a JPEG image, replaces the XMP XML and writes the result to a stream.- Parameters:
- src- Image file.
- os- OutputStream to write the image to.
- xmpXml- String containing XMP XML.
- Throws:
- ImagingException- if it fails to read or write the JFIF segments
- IOException- if it fails to read or write the data from the segments
 
- 
updateXmpXmlpublic void updateXmpXml(InputStream src, OutputStream os, String xmpXml) throws ImagingException, IOException Reads a JPEG image, replaces the XMP XML and writes the result to a stream.- Parameters:
- src- InputStream containing JPEG image data.
- os- OutputStream to write the image to.
- xmpXml- String containing XMP XML.
- Throws:
- ImagingException- if it fails to read or write the JFIF segments
- IOException- if it fails to read or write the data from the segments
 
 
-