public class JPEGTweaker
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ADOBE_ID |
static java.lang.String |
DUCKY_ID |
static java.lang.String |
EXIF_ID |
static java.lang.String |
ICC_PROFILE_ID |
static java.lang.String |
JFIF_ID |
static java.lang.String |
JFXX_ID |
static java.lang.String |
NON_STANDARD_XMP_ID |
static java.lang.String |
PHOTOSHOP_IRB_ID |
static java.lang.String |
PICTURE_INFO_ID |
static java.lang.String |
XMP_EXT_ID |
static java.lang.String |
XMP_ID |
Modifier and Type | Method and Description |
---|---|
static void |
extractDepthMap(java.io.InputStream is,
java.lang.String pathToDepthMap) |
static byte[] |
extractICCProfile(java.io.InputStream is) |
static void |
extractICCProfile(java.io.InputStream is,
java.lang.String pathToICCProfile) |
static void |
extractThumbnails(java.io.InputStream is,
java.lang.String pathToThumbnail)
Extracts thumbnail images from JFIF/APP0, Exif APP1 and/or Adobe APP13 segment if any.
|
static ICCProfile |
getICCProfile(java.io.InputStream is) |
static void |
insertComments(java.io.InputStream is,
java.io.OutputStream os,
java.util.List<java.lang.String> comments) |
static void |
insertExif(java.io.InputStream is,
java.io.OutputStream os,
Exif exif,
boolean update) |
static void |
insertICCProfile(java.io.InputStream is,
java.io.OutputStream os,
byte[] data)
Insert ICC_Profile as one or more APP2 segments
|
static void |
insertICCProfile(java.io.InputStream is,
java.io.OutputStream os,
java.awt.color.ICC_Profile icc_profile) |
static void |
insertICCProfile(java.io.InputStream is,
java.io.OutputStream os,
ICCProfile icc_profile) |
static void |
insertIPTC(java.io.InputStream is,
java.io.OutputStream os,
java.util.Collection<IPTCDataSet> iptcs,
boolean update)
Inserts a list of IPTCDataSet into a JPEG APP13 Photoshop IRB segment
|
static void |
insertIRB(java.io.InputStream is,
java.io.OutputStream os,
java.util.Collection<_8BIM> bims,
boolean update)
Inserts a collection of _8BIM into a JPEG APP13 Photoshop IRB segment
|
static void |
insertIRBThumbnail(java.io.InputStream is,
java.io.OutputStream os,
java.awt.image.BufferedImage thumbnail) |
static void |
insertMetadata(java.util.Collection<Metadata> metadata,
java.io.InputStream is,
java.io.OutputStream os)
Insert a collection of Metadata into an image
|
static void |
insertXMP(java.io.InputStream is,
java.io.OutputStream os,
java.lang.String xmp,
java.lang.String extendedXmp)
Insert XMP into single APP1 or multiple segments.
|
static void |
insertXMP(java.io.InputStream is,
java.io.OutputStream os,
XMP jpegXmp)
Insert a XMP instance into the image.
|
static java.util.Map<MetadataType,Metadata> |
readMetadata(java.io.InputStream is) |
static void |
removeAPPn(Marker APPn,
java.io.InputStream is,
java.io.OutputStream os) |
static void |
removeMetadata(java.io.InputStream is,
java.io.OutputStream os,
MetadataType... metadataTypes) |
static void |
removeMetadata(java.util.Set<MetadataType> metadataTypes,
java.io.InputStream is,
java.io.OutputStream os) |
public static final java.lang.String XMP_ID
public static final java.lang.String NON_STANDARD_XMP_ID
public static final java.lang.String XMP_EXT_ID
public static final java.lang.String PHOTOSHOP_IRB_ID
public static final java.lang.String EXIF_ID
public static final java.lang.String ICC_PROFILE_ID
public static final java.lang.String JFIF_ID
public static final java.lang.String JFXX_ID
public static final java.lang.String DUCKY_ID
public static final java.lang.String PICTURE_INFO_ID
public static final java.lang.String ADOBE_ID
public static byte[] extractICCProfile(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public static void extractICCProfile(java.io.InputStream is, java.lang.String pathToICCProfile) throws java.io.IOException
java.io.IOException
public static void extractDepthMap(java.io.InputStream is, java.lang.String pathToDepthMap) throws java.io.IOException
java.io.IOException
public static void extractThumbnails(java.io.InputStream is, java.lang.String pathToThumbnail) throws java.io.IOException
is
- InputStream for the JPEG image.pathToThumbnail
- a path or a path and name prefix combination for the extracted thumbnails.java.io.IOException
public static ICCProfile getICCProfile(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public static void insertComments(java.io.InputStream is, java.io.OutputStream os, java.util.List<java.lang.String> comments) throws java.io.IOException
java.io.IOException
public static void insertExif(java.io.InputStream is, java.io.OutputStream os, Exif exif, boolean update) throws java.io.IOException
is
- input image streamos
- output image streamexif
- Exif instanceupdate
- True to keep the original data, otherwise falsejava.lang.Exception
java.io.IOException
public static void insertICCProfile(java.io.InputStream is, java.io.OutputStream os, byte[] data) throws java.io.IOException
is
- input stream for the original imageos
- output stream to write the ICC_Profiledata
- ICC_Profile data array to be insertedjava.io.IOException
public static void insertICCProfile(java.io.InputStream is, java.io.OutputStream os, java.awt.color.ICC_Profile icc_profile) throws java.io.IOException
java.io.IOException
public static void insertICCProfile(java.io.InputStream is, java.io.OutputStream os, ICCProfile icc_profile) throws java.lang.Exception
java.lang.Exception
public static void insertIPTC(java.io.InputStream is, java.io.OutputStream os, java.util.Collection<IPTCDataSet> iptcs, boolean update) throws java.io.IOException
is
- InputStream for the original imageos
- OutputStream for the image with IPTC insertediptcs
- a collection of IPTCDataSet to be insertedupdate
- boolean if true, keep the original IPTC data; otherwise, replace it completely with the new IPTC datajava.io.IOException
public static void insertIRB(java.io.InputStream is, java.io.OutputStream os, java.util.Collection<_8BIM> bims, boolean update) throws java.io.IOException
is
- InputStream for the original imageos
- OutputStream for the image with _8BIMs insertedbims
- a collection of _8BIM to be insertedupdate
- boolean if true, keep the other _8BIMs; otherwise, replace the whole IRB with the inserted _8BIMsjava.io.IOException
public static void insertIRBThumbnail(java.io.InputStream is, java.io.OutputStream os, java.awt.image.BufferedImage thumbnail) throws java.io.IOException
java.io.IOException
public static void insertMetadata(java.util.Collection<Metadata> metadata, java.io.InputStream is, java.io.OutputStream os) throws java.io.IOException
metadata
- a collection of Metadata to be insertedis
- InputStream for the imageos
- OutputStream for the image with Metadata insertedjava.io.IOException
public static void insertXMP(java.io.InputStream is, java.io.OutputStream os, XMP jpegXmp) throws java.io.IOException
is
- InputStream for the image.os
- OutputStream for the image.jpegXmp
- XMP instancejava.io.IOException
public static void insertXMP(java.io.InputStream is, java.io.OutputStream os, java.lang.String xmp, java.lang.String extendedXmp) throws java.io.IOException
When converted to bytes, the XMP part should be able to fit into one APP1.
is
- InputStream for the image.os
- OutputStream for the image.xmp
- XML string for the XMP - Assuming in UTF-8 format.extendedXmp
- XML string for the extended XMP - Assuming in UTF-8 formatjava.io.IOException
public static java.util.Map<MetadataType,Metadata> readMetadata(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public static void removeAPPn(Marker APPn, java.io.InputStream is, java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public static void removeMetadata(java.io.InputStream is, java.io.OutputStream os, MetadataType... metadataTypes) throws java.io.IOException
java.io.IOException
public static void removeMetadata(java.util.Set<MetadataType> metadataTypes, java.io.InputStream is, java.io.OutputStream os) throws java.io.IOException
java.io.IOException