Class JpegIptcRewriter


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

      Constructors 
      Constructor Description
      JpegIptcRewriter()
      Constructs a new instance with the default, big-endian, byte order.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void removeIptc​(byte[] src, java.io.OutputStream os)
      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.
      void removeIptc​(byte[] src, java.io.OutputStream os, boolean removeSegment)
      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.
      void removeIptc​(java.io.File src, java.io.OutputStream os)
      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.
      void removeIptc​(java.io.File src, java.io.OutputStream os, boolean removeSegment)
      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.
      void removeIptc​(java.io.InputStream src, java.io.OutputStream os)
      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.
      void removeIptc​(java.io.InputStream src, java.io.OutputStream os, boolean removeSegment)
      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.
      void removeIptc​(ByteSource byteSource, java.io.OutputStream os)
      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.
      void removeIptc​(ByteSource byteSource, java.io.OutputStream os, boolean removeSegment)
      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.
      void writeIptc​(byte[] src, java.io.OutputStream os, PhotoshopApp13Data newData)
      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.
      void writeIptc​(java.io.File src, java.io.OutputStream os, PhotoshopApp13Data newData)
      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.
      void writeIptc​(java.io.InputStream src, java.io.OutputStream os, PhotoshopApp13Data newData)
      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.
      void writeIptc​(ByteSource byteSource, java.io.OutputStream os, PhotoshopApp13Data newData)
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JpegIptcRewriter

        public JpegIptcRewriter()
        Constructs a new instance with the default, big-endian, byte order.
    • Method Detail

      • removeIptc

        public void removeIptc​(byte[] src,
                               java.io.OutputStream os)
                        throws ImagingException,
                               java.io.IOException,
                               ImagingException
        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:
        ImagingException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
        java.io.IOException - if it fails to read from the origin byte source, or to write to the target byte source
        ImagingException - if it fails to write the target image
      • removeIptc

        public void removeIptc​(byte[] src,
                               java.io.OutputStream os,
                               boolean removeSegment)
                        throws ImagingException,
                               java.io.IOException,
                               ImagingException
        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:
        ImagingException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
        java.io.IOException - if it fails to read from the origin byte source, or to write to the target byte source
        ImagingException - if it fails to write the target image
      • removeIptc

        public void removeIptc​(ByteSource byteSource,
                               java.io.OutputStream os)
                        throws ImagingException,
                               java.io.IOException,
                               ImagingException
        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:
        ImagingException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
        java.io.IOException - if it fails to read from the origin byte source, or to write to the target byte source
        ImagingException - if it fails to write the target image
      • removeIptc

        public void removeIptc​(ByteSource byteSource,
                               java.io.OutputStream os,
                               boolean removeSegment)
                        throws ImagingException,
                               java.io.IOException,
                               ImagingException
        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:
        ImagingException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
        java.io.IOException - if it fails to read from the origin byte source, or to write to the target byte source
        ImagingException - if it fails to write the target image
      • removeIptc

        public void removeIptc​(java.io.File src,
                               java.io.OutputStream os)
                        throws ImagingException,
                               java.io.IOException,
                               ImagingException
        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:
        ImagingException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
        java.io.IOException - if it fails to read from the origin byte source, or to write to the target byte source
        ImagingException - if it fails to write the target image
        See Also:
        File, OutputStream
      • removeIptc

        public void removeIptc​(java.io.File src,
                               java.io.OutputStream os,
                               boolean removeSegment)
                        throws ImagingException,
                               java.io.IOException,
                               ImagingException
        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:
        ImagingException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
        java.io.IOException - if it fails to read from the origin byte source, or to write to the target byte source
        ImagingException - if it fails to write the target image
        See Also:
        File, OutputStream
      • removeIptc

        public void removeIptc​(java.io.InputStream src,
                               java.io.OutputStream os)
                        throws ImagingException,
                               java.io.IOException,
                               ImagingException
        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:
        ImagingException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
        java.io.IOException - if it fails to read from the origin byte source, or to write to the target byte source
        ImagingException - if it fails to write the target image
      • removeIptc

        public void removeIptc​(java.io.InputStream src,
                               java.io.OutputStream os,
                               boolean removeSegment)
                        throws ImagingException,
                               java.io.IOException,
                               ImagingException
        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:
        ImagingException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
        java.io.IOException - if it fails to read from the origin byte source, or to write to the target byte source
        ImagingException - if it fails to write the target image
      • writeIptc

        public void writeIptc​(byte[] src,
                              java.io.OutputStream os,
                              PhotoshopApp13Data newData)
                       throws ImagingException,
                              java.io.IOException,
                              ImagingException
        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:
        ImagingException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
        java.io.IOException - if it fails to read from the origin byte source, or to write to the target byte source
        ImagingException - if it fails to write the target image
      • writeIptc

        public void writeIptc​(ByteSource byteSource,
                              java.io.OutputStream os,
                              PhotoshopApp13Data newData)
                       throws ImagingException,
                              java.io.IOException,
                              ImagingException
        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:
        ImagingException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
        java.io.IOException - if it fails to read from the origin byte source, or to write to the target byte source
        ImagingException - if it fails to write the target image
      • writeIptc

        public void writeIptc​(java.io.File src,
                              java.io.OutputStream os,
                              PhotoshopApp13Data newData)
                       throws ImagingException,
                              java.io.IOException,
                              ImagingException
        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:
        ImagingException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
        java.io.IOException - if it fails to read from the origin byte source, or to write to the target byte source
        ImagingException - if it fails to write the target image
      • writeIptc

        public void writeIptc​(java.io.InputStream src,
                              java.io.OutputStream os,
                              PhotoshopApp13Data newData)
                       throws ImagingException,
                              java.io.IOException,
                              ImagingException
        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:
        ImagingException - if there are more than one Photoshop App13 segment, or if the Photoshop segment cannot be parsed
        java.io.IOException - if it fails to read from the origin byte source, or to write to the target byte source
        ImagingException - if it fails to write the target image