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

# Class JpegRewriter

java.lang.Object
org.apache.commons.imaging.common.BinaryFileParser
org.apache.commons.imaging.formats.jpeg.xmp.JpegRewriter

Direct Known Subclasses:
  `JpegIptcRewriter`, `JpegXmpRewriter`

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

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `protected static class`
  `JpegRewriter.JFIFPiece`
  `protected static class`
  `JpegRewriter.JFIFPieces`
  `protected static class`
  `JpegRewriter.JFIFPieceSegment`

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected JpegRewriter.JFIFPieces`
  `analyzeJfif(ByteSource byteSource)`
  `protected <T extends JpegRewriter.JFIFPiece>
  List<T>`
  `filterSegments(List<T> segments, org.apache.commons.imaging.formats.jpeg.xmp.JpegRewriter.SegmentFilter filter)`
  `protected <T extends JpegRewriter.JFIFPiece>
  List<T>`
  `filterSegments(List<T> segments, org.apache.commons.imaging.formats.jpeg.xmp.JpegRewriter.SegmentFilter filter, boolean reverse)`
  `protected <T extends JpegRewriter.JFIFPiece>
  List<T>`
  `findPhotoshopApp13Segments(List<T> segments)`
  `protected <T extends JpegRewriter.JFIFPiece, U extends JpegRewriter.JFIFPiece>
  List<JpegRewriter.JFIFPiece>`
  `insertAfterLastAppSegments(List<T> segments, List<U> newSegments)`
  `protected <T extends JpegRewriter.JFIFPiece, U extends JpegRewriter.JFIFPiece>
  List<JpegRewriter.JFIFPiece>`
  `insertBeforeFirstAppSegments(List<T> segments, List<U> newSegments)`
  `protected <T extends JpegRewriter.JFIFPiece>
  List<T>`
  `removeExifSegments(List<T> segments)`
  `protected <T extends JpegRewriter.JFIFPiece>
  List<T>`
  `removePhotoshopApp13Segments(List<T> segments)`
  `protected <T extends JpegRewriter.JFIFPiece>
  List<T>`
  `removeXmpSegments(List<T> segments)`
  `protected void`
  `writeSegments(OutputStream outputStream, List<? extends JpegRewriter.JFIFPiece> segments)`

  ### 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

  - ### JpegRewriter

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

    Whether a file contains an image based on its file extension.

- ## Method Details

  - ### analyzeJfif

    protected JpegRewriter.JFIFPieces analyzeJfif(ByteSource byteSource) throws ImagingException, IOException
    Throws:
      `ImagingException`
      `IOException`

  - ### filterSegments

    protected <T extends JpegRewriter.JFIFPiece> List<T> filterSegments(List<T> segments, org.apache.commons.imaging.formats.jpeg.xmp.JpegRewriter.SegmentFilter filter)

  - ### filterSegments

    protected <T extends JpegRewriter.JFIFPiece> List<T> filterSegments(List<T> segments, org.apache.commons.imaging.formats.jpeg.xmp.JpegRewriter.SegmentFilter filter, boolean reverse)

  - ### findPhotoshopApp13Segments

    protected <T extends JpegRewriter.JFIFPiece> List<T> findPhotoshopApp13Segments(List<T> segments)

  - ### insertAfterLastAppSegments

    protected <T extends JpegRewriter.JFIFPiece, U extends JpegRewriter.JFIFPiece> List<JpegRewriter.JFIFPiece> insertAfterLastAppSegments(List<T> segments, List<U> newSegments) throws ImagingException
    Throws:
      `ImagingException`

  - ### insertBeforeFirstAppSegments

    protected <T extends JpegRewriter.JFIFPiece, U extends JpegRewriter.JFIFPiece> List<JpegRewriter.JFIFPiece> insertBeforeFirstAppSegments(List<T> segments, List<U> newSegments) throws ImagingException
    Throws:
      `ImagingException`

  - ### removeExifSegments

    protected <T extends JpegRewriter.JFIFPiece> List<T> removeExifSegments(List<T> segments)

  - ### removePhotoshopApp13Segments

    protected <T extends JpegRewriter.JFIFPiece> List<T> removePhotoshopApp13Segments(List<T> segments)

  - ### removeXmpSegments

    protected <T extends JpegRewriter.JFIFPiece> List<T> removeXmpSegments(List<T> segments)

  - ### writeSegments

    protected void writeSegments(OutputStream outputStream, List<? extends JpegRewriter.JFIFPiece> segments) throws IOException
    Throws:
      `IOException`