Package org.apache.commons.imaging.formats.jpeg.xmp

# 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

public class JpegXmpRewriter extends JpegRewriter
Interface for Exif write/update/remove functionality for Jpeg/JFIF images.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.commons.imaging.formats.jpeg.xmp.JpegRewriter

  `JpegRewriter.JFIFPiece, JpegRewriter.JFIFPieces, JpegRewriter.JFIFPieceSegment`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JpegXmpRewriter()`
  Constructs a new instance with the default, big-endian, byte order.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `removeXmpXml(byte[] src, OutputStream os)`
  Reads a JPEG image, removes all XMP XML (by removing the APP1 segment), and writes the result to a stream.
  `void`
  `removeXmpXml(File src, OutputStream os)`
  Reads a JPEG image, removes all XMP XML (by removing the APP1 segment), and writes the result to a stream.
  `void`
  `removeXmpXml(InputStream src, OutputStream os)`
  Reads a JPEG image, removes all XMP XML (by removing the APP1 segment), and writes the result to a stream.
  `void`
  `removeXmpXml(ByteSource byteSource, OutputStream os)`
  Reads a JPEG image, removes all XMP XML (by removing the APP1 segment), and writes the result to a stream.
  `void`
  `updateXmpXml(byte[] src, OutputStream os, String xmpXml)`
  Reads a JPEG image, replaces the XMP XML and writes the result to a stream.
  `void`
  `updateXmpXml(File src, OutputStream os, String xmpXml)`
  Reads a JPEG image, replaces the XMP XML and writes the result to a stream.
  `void`
  `updateXmpXml(InputStream src, OutputStream os, String xmpXml)`
  Reads a JPEG image, replaces the XMP XML and writes the result to a stream.
  `void`
  `updateXmpXml(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.JpegRewriter

  `analyzeJfif, filterSegments, filterSegments, findPhotoshopApp13Segments, insertAfterLastAppSegments, insertBeforeFirstAppSegments, removeExifSegments, removePhotoshopApp13Segments, removeXmpSegments, writeSegments`

  ### Methods inherited from class org.apache.commons.imaging.common.BinaryFileParser

  `debugNumber, debugNumber, getByteOrder, setByteOrder`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### JpegXmpRewriter

    public JpegXmpRewriter()
    Constructs a new instance with the default, big-endian, byte order.

- ## Method Details

  - ### removeXmpXml

    public void removeXmpXml(byte[] src, 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:
      `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

  - ### removeXmpXml

    public 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

  - ### removeXmpXml

    public void removeXmpXml(File src, 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:
      `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:
      - `File`
      - `OutputStream`

  - ### removeXmpXml

    public void removeXmpXml(InputStream src, 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:
      `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

  - ### updateXmpXml

    public 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

  - ### updateXmpXml

    public 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

  - ### updateXmpXml

    public 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

  - ### updateXmpXml

    public 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