public class ExifRewriter extends BinaryFileParser
See the source of the ExifMetadataUpdateExample class for example usage.
Modifier and Type | Class and Description |
---|---|
static class |
ExifRewriter.ExifOverflowException |
Constructor and Description |
---|
ExifRewriter()
Constructor.
|
ExifRewriter(java.nio.ByteOrder byteOrder)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
removeExifMetadata(byte[] src,
java.io.OutputStream os)
Reads a Jpeg image, removes all EXIF metadata (by removing the APP1
segment), and writes the result to a stream.
|
void |
removeExifMetadata(ByteSource byteSource,
java.io.OutputStream os)
Reads a Jpeg image, removes all EXIF metadata (by removing the APP1
segment), and writes the result to a stream.
|
void |
removeExifMetadata(java.io.File src,
java.io.OutputStream os)
Reads a Jpeg image, removes all EXIF metadata (by removing the APP1
segment), and writes the result to a stream.
|
void |
removeExifMetadata(java.io.InputStream src,
java.io.OutputStream os)
Reads a Jpeg image, removes all EXIF metadata (by removing the APP1
segment), and writes the result to a stream.
|
void |
updateExifMetadataLossless(byte[] src,
java.io.OutputStream os,
TiffOutputSet outputSet)
Reads a Jpeg image, replaces the EXIF metadata and writes the result to a
stream.
|
void |
updateExifMetadataLossless(ByteSource byteSource,
java.io.OutputStream os,
TiffOutputSet outputSet)
Reads a Jpeg image, replaces the EXIF metadata and writes the result to a
stream.
|
void |
updateExifMetadataLossless(java.io.File src,
java.io.OutputStream os,
TiffOutputSet outputSet)
Reads a Jpeg image, replaces the EXIF metadata and writes the result to a
stream.
|
void |
updateExifMetadataLossless(java.io.InputStream src,
java.io.OutputStream os,
TiffOutputSet outputSet)
Reads a Jpeg image, replaces the EXIF metadata and writes the result to a
stream.
|
void |
updateExifMetadataLossy(byte[] src,
java.io.OutputStream os,
TiffOutputSet outputSet)
Reads a Jpeg image, replaces the EXIF metadata and writes the result to a
stream.
|
void |
updateExifMetadataLossy(ByteSource byteSource,
java.io.OutputStream os,
TiffOutputSet outputSet)
Reads a Jpeg image, replaces the EXIF metadata and writes the result to a
stream.
|
void |
updateExifMetadataLossy(java.io.File src,
java.io.OutputStream os,
TiffOutputSet outputSet)
Reads a Jpeg image, replaces the EXIF metadata and writes the result to a
stream.
|
void |
updateExifMetadataLossy(java.io.InputStream src,
java.io.OutputStream os,
TiffOutputSet outputSet)
Reads a Jpeg image, replaces the EXIF metadata and writes the result to a
stream.
|
getByteOrder, getDebug, setDebug
public ExifRewriter()
public ExifRewriter(java.nio.ByteOrder byteOrder)
byteOrder
- byte order of EXIF segment.public void removeExifMetadata(java.io.File src, java.io.OutputStream os) throws ImageReadException, java.io.IOException, ImageWriteException
src
- Image file.os
- OutputStream to write the image to.ImageReadException
java.io.IOException
ImageWriteException
File
,
OutputStream
,
File
,
OutputStream
public void removeExifMetadata(byte[] src, java.io.OutputStream os) throws ImageReadException, java.io.IOException, ImageWriteException
src
- Byte array containing Jpeg image data.os
- OutputStream to write the image to.ImageReadException
java.io.IOException
ImageWriteException
public void removeExifMetadata(java.io.InputStream src, java.io.OutputStream os) throws ImageReadException, java.io.IOException, ImageWriteException
src
- InputStream containing Jpeg image data.os
- OutputStream to write the image to.ImageReadException
java.io.IOException
ImageWriteException
public void removeExifMetadata(ByteSource byteSource, java.io.OutputStream os) throws ImageReadException, java.io.IOException, ImageWriteException
byteSource
- ByteSource containing Jpeg image data.os
- OutputStream to write the image to.ImageReadException
java.io.IOException
ImageWriteException
public void updateExifMetadataLossless(java.io.File src, java.io.OutputStream os, TiffOutputSet outputSet) throws ImageReadException, java.io.IOException, ImageWriteException
Note that this uses the "Lossless" approach - in order to preserve data embedded in the EXIF segment that it can't parse (such as Maker Notes), this algorithm avoids overwriting any part of the original segment that it couldn't parse. This can cause the EXIF segment to grow with each update, which is a serious issue, since all EXIF data must fit in a single APP1 segment of the Jpeg image.
src
- Image file.os
- OutputStream to write the image to.outputSet
- TiffOutputSet containing the EXIF data to write.ImageReadException
java.io.IOException
ImageWriteException
public void updateExifMetadataLossless(byte[] src, java.io.OutputStream os, TiffOutputSet outputSet) throws ImageReadException, java.io.IOException, ImageWriteException
Note that this uses the "Lossless" approach - in order to preserve data embedded in the EXIF segment that it can't parse (such as Maker Notes), this algorithm avoids overwriting any part of the original segment that it couldn't parse. This can cause the EXIF segment to grow with each update, which is a serious issue, since all EXIF data must fit in a single APP1 segment of the Jpeg image.
src
- Byte array containing Jpeg image data.os
- OutputStream to write the image to.outputSet
- TiffOutputSet containing the EXIF data to write.ImageReadException
java.io.IOException
ImageWriteException
public void updateExifMetadataLossless(java.io.InputStream src, java.io.OutputStream os, TiffOutputSet outputSet) throws ImageReadException, java.io.IOException, ImageWriteException
Note that this uses the "Lossless" approach - in order to preserve data embedded in the EXIF segment that it can't parse (such as Maker Notes), this algorithm avoids overwriting any part of the original segment that it couldn't parse. This can cause the EXIF segment to grow with each update, which is a serious issue, since all EXIF data must fit in a single APP1 segment of the Jpeg image.
src
- InputStream containing Jpeg image data.os
- OutputStream to write the image to.outputSet
- TiffOutputSet containing the EXIF data to write.ImageReadException
java.io.IOException
ImageWriteException
public void updateExifMetadataLossless(ByteSource byteSource, java.io.OutputStream os, TiffOutputSet outputSet) throws ImageReadException, java.io.IOException, ImageWriteException
Note that this uses the "Lossless" approach - in order to preserve data embedded in the EXIF segment that it can't parse (such as Maker Notes), this algorithm avoids overwriting any part of the original segment that it couldn't parse. This can cause the EXIF segment to grow with each update, which is a serious issue, since all EXIF data must fit in a single APP1 segment of the Jpeg image.
byteSource
- ByteSource containing Jpeg image data.os
- OutputStream to write the image to.outputSet
- TiffOutputSet containing the EXIF data to write.ImageReadException
java.io.IOException
ImageWriteException
public void updateExifMetadataLossy(byte[] src, java.io.OutputStream os, TiffOutputSet outputSet) throws ImageReadException, java.io.IOException, ImageWriteException
Note that this uses the "Lossy" approach - the algorithm overwrites the entire EXIF segment, ignoring the possibility that it may be discarding data it couldn't parse (such as Maker Notes).
src
- Byte array containing Jpeg image data.os
- OutputStream to write the image to.outputSet
- TiffOutputSet containing the EXIF data to write.ImageReadException
java.io.IOException
ImageWriteException
public void updateExifMetadataLossy(java.io.InputStream src, java.io.OutputStream os, TiffOutputSet outputSet) throws ImageReadException, java.io.IOException, ImageWriteException
Note that this uses the "Lossy" approach - the algorithm overwrites the entire EXIF segment, ignoring the possibility that it may be discarding data it couldn't parse (such as Maker Notes).
src
- InputStream containing Jpeg image data.os
- OutputStream to write the image to.outputSet
- TiffOutputSet containing the EXIF data to write.ImageReadException
java.io.IOException
ImageWriteException
public void updateExifMetadataLossy(java.io.File src, java.io.OutputStream os, TiffOutputSet outputSet) throws ImageReadException, java.io.IOException, ImageWriteException
Note that this uses the "Lossy" approach - the algorithm overwrites the entire EXIF segment, ignoring the possibility that it may be discarding data it couldn't parse (such as Maker Notes).
src
- Image file.os
- OutputStream to write the image to.outputSet
- TiffOutputSet containing the EXIF data to write.ImageReadException
java.io.IOException
ImageWriteException
public void updateExifMetadataLossy(ByteSource byteSource, java.io.OutputStream os, TiffOutputSet outputSet) throws ImageReadException, java.io.IOException, ImageWriteException
Note that this uses the "Lossy" approach - the algorithm overwrites the entire EXIF segment, ignoring the possibility that it may be discarding data it couldn't parse (such as Maker Notes).
byteSource
- ByteSource containing Jpeg image data.os
- OutputStream to write the image to.outputSet
- TiffOutputSet containing the EXIF data to write.ImageReadException
java.io.IOException
ImageWriteException
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"