Class JpegIptcRewriter
- java.lang.Object
-
- org.apache.commons.imaging.common.BinaryFileParser
-
- org.apache.commons.imaging.formats.jpeg.xmp.JpegRewriter
-
- org.apache.commons.imaging.formats.jpeg.iptc.JpegIptcRewriter
-
public class JpegIptcRewriter 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 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 voidremoveIptc(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.voidremoveIptc(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.voidremoveIptc(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.voidremoveIptc(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.voidremoveIptc(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.voidremoveIptc(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.voidremoveIptc(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.voidremoveIptc(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.voidwriteIptc(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.voidwriteIptc(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.voidwriteIptc(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.voidwriteIptc(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 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
-
-
-
-
Method Detail
-
removeIptc
public void removeIptc(byte[] src, java.io.OutputStream os) throws ImagingException, java.io.IOException, ImagingExceptionReads 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 parsedjava.io.IOException- if it fails to read from the origin byte source, or to write to the target byte sourceImagingException- 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, ImagingExceptionReads 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 parsedjava.io.IOException- if it fails to read from the origin byte source, or to write to the target byte sourceImagingException- 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 parsedjava.io.IOException- if it fails to read from the origin byte source, or to write to the target byte sourceImagingException- 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 parsedjava.io.IOException- if it fails to read from the origin byte source, or to write to the target byte sourceImagingException- 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, ImagingExceptionReads 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 parsedjava.io.IOException- if it fails to read from the origin byte source, or to write to the target byte sourceImagingException- 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, ImagingExceptionReads 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 parsedjava.io.IOException- if it fails to read from the origin byte source, or to write to the target byte sourceImagingException- 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, ImagingExceptionReads 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 parsedjava.io.IOException- if it fails to read from the origin byte source, or to write to the target byte sourceImagingException- 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, ImagingExceptionReads 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 parsedjava.io.IOException- if it fails to read from the origin byte source, or to write to the target byte sourceImagingException- 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, ImagingExceptionReads 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 parsedjava.io.IOException- if it fails to read from the origin byte source, or to write to the target byte sourceImagingException- 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 parsedjava.io.IOException- if it fails to read from the origin byte source, or to write to the target byte sourceImagingException- 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, ImagingExceptionReads 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 parsedjava.io.IOException- if it fails to read from the origin byte source, or to write to the target byte sourceImagingException- 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, ImagingExceptionReads 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 parsedjava.io.IOException- if it fails to read from the origin byte source, or to write to the target byte sourceImagingException- if it fails to write the target image
-
-