Class JpegIptcRewriter


public class JpegIptcRewriter extends JpegRewriter
Interface for Exif write/update/remove functionality for Jpeg/JFIF images.
  • Constructor Details

    • JpegIptcRewriter

      public JpegIptcRewriter()
  • Method Details

    • removeIPTC

      public void removeIPTC(File src, OutputStream os) throws ImageReadException, IOException, ImageWriteException
      Reads a Jpeg image, removes all IPTC data from the App13 segment but leaves the other data in that segment (if present) unchanged and writes the result to a stream.

      Parameters:
      src - Image file.
      os - OutputStream to write the image to.
      Throws:
      ImageReadException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
      IOException - if it fails to read from the origin byte source, or to write to the target byte source
      ImageWriteException - if it fails to write the target image
      See Also:
    • removeIPTC

      public void removeIPTC(File src, OutputStream os, boolean removeSegment) throws ImageReadException, IOException, ImageWriteException
      Reads a Jpeg image, removes all IPTC data from the App13 segment but leaves the other data in that segment (if present) unchanged (unless removeSegment is true) and writes the result to a stream.

      Parameters:
      src - Image file.
      os - OutputStream to write the image to.
      removeSegment - Remove the App13 segment.
      Throws:
      ImageReadException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
      IOException - if it fails to read from the origin byte source, or to write to the target byte source
      ImageWriteException - if it fails to write the target image
      See Also:
    • removeIPTC

      public void removeIPTC(byte[] src, OutputStream os) throws ImageReadException, IOException, ImageWriteException
      Reads a Jpeg image, removes all IPTC data from the App13 segment but leaves the other data in that segment (if present) unchanged and writes the result to a stream.

      Parameters:
      src - Byte array containing Jpeg image data.
      os - OutputStream to write the image to.
      Throws:
      ImageReadException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
      IOException - if it fails to read from the origin byte source, or to write to the target byte source
      ImageWriteException - if it fails to write the target image
    • removeIPTC

      public void removeIPTC(byte[] src, OutputStream os, boolean removeSegment) throws ImageReadException, IOException, ImageWriteException
      Reads a Jpeg image, removes all IPTC data from the App13 segment but leaves the other data in that segment (if present) unchanged (unless removeSegment is true) and writes the result to a stream.

      Parameters:
      src - Byte array containing Jpeg image data.
      os - OutputStream to write the image to.
      removeSegment - Remove the App13 segment.
      Throws:
      ImageReadException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
      IOException - if it fails to read from the origin byte source, or to write to the target byte source
      ImageWriteException - if it fails to write the target image
    • removeIPTC

      public void removeIPTC(InputStream src, OutputStream os) throws ImageReadException, IOException, ImageWriteException
      Reads a Jpeg image, removes all IPTC data from the App13 segment but leaves the other data in that segment (if present) unchanged and writes the result to a stream.

      Parameters:
      src - InputStream containing Jpeg image data.
      os - OutputStream to write the image to.
      Throws:
      ImageReadException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
      IOException - if it fails to read from the origin byte source, or to write to the target byte source
      ImageWriteException - if it fails to write the target image
    • removeIPTC

      public void removeIPTC(InputStream src, OutputStream os, boolean removeSegment) throws ImageReadException, IOException, ImageWriteException
      Reads a Jpeg image, removes all IPTC data from the App13 segment but leaves the other data in that segment (if present) unchanged (unless removeSegment is true) and writes the result to a stream.

      Parameters:
      src - InputStream containing Jpeg image data.
      os - OutputStream to write the image to.
      removeSegment - Remove the App13 segment.
      Throws:
      ImageReadException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
      IOException - if it fails to read from the origin byte source, or to write to the target byte source
      ImageWriteException - if it fails to write the target image
    • removeIPTC

      public void removeIPTC(ByteSource byteSource, OutputStream os) throws ImageReadException, IOException, ImageWriteException
      Reads a Jpeg image, removes all IPTC data from the App13 segment but leaves the other data in that segment (if present) unchanged and writes the result to a stream.

      Parameters:
      byteSource - ByteSource containing Jpeg image data.
      os - OutputStream to write the image to.
      Throws:
      ImageReadException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
      IOException - if it fails to read from the origin byte source, or to write to the target byte source
      ImageWriteException - if it fails to write the target image
    • removeIPTC

      public void removeIPTC(ByteSource byteSource, OutputStream os, boolean removeSegment) throws ImageReadException, IOException, ImageWriteException
      Reads a Jpeg image, removes all IPTC data from the App13 segment but leaves the other data in that segment (if present) unchanged (unless removeSegment is true) and writes the result to a stream.

      Parameters:
      byteSource - ByteSource containing Jpeg image data.
      os - OutputStream to write the image to.
      removeSegment - Remove the App13 segment.
      Throws:
      ImageReadException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
      IOException - if it fails to read from the origin byte source, or to write to the target byte source
      ImageWriteException - if it fails to write the target image
    • writeIPTC

      public void writeIPTC(byte[] src, OutputStream os, PhotoshopApp13Data newData) throws ImageReadException, IOException, ImageWriteException
      Reads a Jpeg image, replaces the IPTC data in the App13 segment but leaves the other data in that segment (if present) unchanged and writes the result to a stream.
      Parameters:
      src - Byte array containing Jpeg image data.
      os - OutputStream to write the image to.
      newData - structure containing IPTC data.
      Throws:
      ImageReadException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
      IOException - if it fails to read from the origin byte source, or to write to the target byte source
      ImageWriteException - if it fails to write the target image
    • writeIPTC

      Reads a Jpeg image, replaces the IPTC data in the App13 segment but leaves the other data in that segment (if present) unchanged and writes the result to a stream.
      Parameters:
      src - InputStream containing Jpeg image data.
      os - OutputStream to write the image to.
      newData - structure containing IPTC data.
      Throws:
      ImageReadException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
      IOException - if it fails to read from the origin byte source, or to write to the target byte source
      ImageWriteException - if it fails to write the target image
    • writeIPTC

      public void writeIPTC(File src, OutputStream os, PhotoshopApp13Data newData) throws ImageReadException, IOException, ImageWriteException
      Reads a Jpeg image, replaces the IPTC data in the App13 segment but leaves the other data in that segment (if present) unchanged and writes the result to a stream.
      Parameters:
      src - Image file.
      os - OutputStream to write the image to.
      newData - structure containing IPTC data.
      Throws:
      ImageReadException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
      IOException - if it fails to read from the origin byte source, or to write to the target byte source
      ImageWriteException - if it fails to write the target image
    • writeIPTC

      public void writeIPTC(ByteSource byteSource, OutputStream os, PhotoshopApp13Data newData) throws ImageReadException, IOException, ImageWriteException
      Reads a Jpeg image, replaces the IPTC data in the App13 segment but leaves the other data in that segment (if present) unchanged and writes the result to a stream.
      Parameters:
      byteSource - ByteSource containing Jpeg image data.
      os - OutputStream to write the image to.
      newData - structure containing IPTC data.
      Throws:
      ImageReadException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
      IOException - if it fails to read from the origin byte source, or to write to the target byte source
      ImageWriteException - if it fails to write the target image