org.apache.sanselan.formats.jpeg.iptc
Class JpegIptcRewriter

java.lang.Object
  extended by org.apache.sanselan.common.BinaryFileFunctions
      extended by org.apache.sanselan.common.BinaryFileParser
          extended by org.apache.sanselan.formats.jpeg.xmp.JpegRewriter
              extended by org.apache.sanselan.formats.jpeg.iptc.JpegIptcRewriter
All Implemented Interfaces:
BinaryConstants, IPTCConstants, JpegConstants

public class JpegIptcRewriter
extends JpegRewriter
implements IPTCConstants

Interface for Exif write/update/remove functionality for Jpeg/JFIF images.

See the source of the IPTCUpdateExample class for example usage.

See Also:
org.apache.sanselan.sampleUsage.WriteIPTCExample

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.sanselan.formats.jpeg.xmp.JpegRewriter
JpegRewriter.JFIFPiece, JpegRewriter.JFIFPieceImageData, JpegRewriter.JFIFPieces, JpegRewriter.JFIFPieceSegment, JpegRewriter.JpegSegmentOverflowException
 
Field Summary
 
Fields inherited from class org.apache.sanselan.common.BinaryFileFunctions
debug
 
Fields inherited from interface org.apache.sanselan.formats.jpeg.iptc.IPTCConstants
IMAGE_RESOURCE_BLOCK_ALPHA_CHANNELS_NAMES, IMAGE_RESOURCE_BLOCK_ALPHA_IDENTIFIERS, IMAGE_RESOURCE_BLOCK_ALTERNATE_DUOTONE_COLORS, IMAGE_RESOURCE_BLOCK_ALTERNATE_SPOT_COLORS, IMAGE_RESOURCE_BLOCK_BACKGROUND_COLOR, IMAGE_RESOURCE_BLOCK_BORDER_INFORMATION, IMAGE_RESOURCE_BLOCK_BW_HALFTONING_INFO, IMAGE_RESOURCE_BLOCK_BW_TRANSFER_FUNC, IMAGE_RESOURCE_BLOCK_CAPTION_DIGEST, IMAGE_RESOURCE_BLOCK_CLIPPING_PATH_NAME, IMAGE_RESOURCE_BLOCK_COLOR_HALFTONING_INFO, IMAGE_RESOURCE_BLOCK_COLOR_SAMPLERS_RESOURCE, IMAGE_RESOURCE_BLOCK_COLOR_TRANSFER_FUNCS, IMAGE_RESOURCE_BLOCK_COPYRIGHT_FLAG, IMAGE_RESOURCE_BLOCK_DISPLAY_INFO, IMAGE_RESOURCE_BLOCK_DUOTONE_HALFTONING_INFO, IMAGE_RESOURCE_BLOCK_DUOTONE_IMAGE_INFO, IMAGE_RESOURCE_BLOCK_DUOTONE_TRANSFER_FUNCS, IMAGE_RESOURCE_BLOCK_EFFECTIVE_BW, IMAGE_RESOURCE_BLOCK_EFFECTS_VISIBLE, IMAGE_RESOURCE_BLOCK_EPS_OPTIONS, IMAGE_RESOURCE_BLOCK_EXIF_INFO2, IMAGE_RESOURCE_BLOCK_EXIFINFO, IMAGE_RESOURCE_BLOCK_GLOBAL_ALTITUDE, IMAGE_RESOURCE_BLOCK_GLOBAL_ANGLE, IMAGE_RESOURCE_BLOCK_GRID_GUIDES_INFO, IMAGE_RESOURCE_BLOCK_ICC_PROFILE, IMAGE_RESOURCE_BLOCK_ICC_UNTAGGED, IMAGE_RESOURCE_BLOCK_IDS_BASE_VALUE, IMAGE_RESOURCE_BLOCK_INDEXED_COLOUR_TABLE_COUNT, IMAGE_RESOURCE_BLOCK_IPTC_DATA, IMAGE_RESOURCE_BLOCK_JPEG_QUALITY, IMAGE_RESOURCE_BLOCK_JUMP_TO_XPEP, IMAGE_RESOURCE_BLOCK_LAYER_COMPS, IMAGE_RESOURCE_BLOCK_LAYER_STATE_INFO, IMAGE_RESOURCE_BLOCK_LAYERS_GROUP_INFO, IMAGE_RESOURCE_BLOCK_MACINTOSH_PRINT_INFO, IMAGE_RESOURCE_BLOCK_OBSOLETE_PHOTOSHOP_TAG1, IMAGE_RESOURCE_BLOCK_OBSOLETE_PHOTOSHOP_TAG2, IMAGE_RESOURCE_BLOCK_OBSOLETE_PHOTOSHOP_TAG3, IMAGE_RESOURCE_BLOCK_PHOTOSHOP_BGR_THUMBNAIL, IMAGE_RESOURCE_BLOCK_PHOTOSHOP_THUMBNAIL, IMAGE_RESOURCE_BLOCK_PHOTOSHOP2_COLOR_TABLE, IMAGE_RESOURCE_BLOCK_PHOTOSHOP2_INFO, IMAGE_RESOURCE_BLOCK_PIXEL_ASPECT_RATIO, IMAGE_RESOURCE_BLOCK_PRINT_FLAGS, IMAGE_RESOURCE_BLOCK_PRINT_FLAGS_INFO, IMAGE_RESOURCE_BLOCK_PRINT_SCALE, IMAGE_RESOURCE_BLOCK_PSTRING_CAPTION, IMAGE_RESOURCE_BLOCK_QUICK_MASK_INFO, IMAGE_RESOURCE_BLOCK_RAW_IMAGE_MODE, IMAGE_RESOURCE_BLOCK_RESOLUTION_INFO, IMAGE_RESOURCE_BLOCK_SLICES, IMAGE_RESOURCE_BLOCK_SPOT_HALFTONE, IMAGE_RESOURCE_BLOCK_TRANSPARENT_INDEX, IMAGE_RESOURCE_BLOCK_UNICODE_ALPHA_NAMES, IMAGE_RESOURCE_BLOCK_URL, IMAGE_RESOURCE_BLOCK_URL_LIST, IMAGE_RESOURCE_BLOCK_VERSION_INFO, IMAGE_RESOURCE_BLOCK_WATERMARK, IMAGE_RESOURCE_BLOCK_WORKFLOW_URL, IMAGE_RESOURCE_BLOCK_WORKING_PATH, IMAGE_RESOURCE_BLOCK_XML_DATA, IMAGE_RESOURCE_BLOCK_XMP, IPTC_APPLICATION_2_RECORD_NUMBER, IPTC_ENVELOPE_RECORD_NUMBER, IPTC_NON_EXTENDED_RECORD_MAXIMUM_SIZE, IPTC_PREFIX, IPTC_RECORD_TAG_MARKER, IPTC_TYPE_ACTION_ADVISED, IPTC_TYPE_AUDIO_DURATION, IPTC_TYPE_AUDIO_OUTCUE, IPTC_TYPE_AUDIO_SAMPLING_RATE, IPTC_TYPE_AUDIO_SAMPLING_RESOLUTION, IPTC_TYPE_AUDIO_TYPE, IPTC_TYPE_BYLINE, IPTC_TYPE_BYLINE_TITLE, IPTC_TYPE_CAPTION_ABSTRACT, IPTC_TYPE_CATEGORY, IPTC_TYPE_CITY, IPTC_TYPE_CONTACT, IPTC_TYPE_CONTENT_LOCATION_CODE, IPTC_TYPE_CONTENT_LOCATION_NAME, IPTC_TYPE_COPYRIGHT_NOTICE, IPTC_TYPE_COUNTRY_PRIMARY_LOCATION_CODE, IPTC_TYPE_COUNTRY_PRIMARY_LOCATION_NAME, IPTC_TYPE_CREDIT, IPTC_TYPE_DATE_CREATED, IPTC_TYPE_DIGITAL_CREATION_DATE, IPTC_TYPE_DIGITAL_CREATION_TIME, IPTC_TYPE_EDIT_STATUS, IPTC_TYPE_EDITORIAL_UPDATE, IPTC_TYPE_EXPIRATION_DATE, IPTC_TYPE_EXPIRATION_TIME, IPTC_TYPE_FIXTURE_IDENTIFIER, IPTC_TYPE_HEADLINE, IPTC_TYPE_IMAGE_ORIENTATION, IPTC_TYPE_IMAGE_TYPE, IPTC_TYPE_KEYWORDS, IPTC_TYPE_LANGUAGE_IDENTIFIER, IPTC_TYPE_OBJECT_ATTRIBUTE_REFERENCE, IPTC_TYPE_OBJECT_CYCLE, IPTC_TYPE_OBJECT_DATA_PREVIEW_DATA, IPTC_TYPE_OBJECT_DATA_PREVIEW_FILE_FORMAT, IPTC_TYPE_OBJECT_DATA_PREVIEW_FILE_FORMAT_VERSION, IPTC_TYPE_OBJECT_NAME, IPTC_TYPE_OBJECT_TYPE_REFERENCE, IPTC_TYPE_ORIGINAL_TRANSMISSION_REFERENCE, IPTC_TYPE_ORIGINATING_PROGRAM, IPTC_TYPE_PROGRAM_VERSION, IPTC_TYPE_PROVINCE_STATE, IPTC_TYPE_RASTERIZED_CAPTION, IPTC_TYPE_RECORD_VERSION, IPTC_TYPE_REFERENCE_DATE, IPTC_TYPE_REFERENCE_NUMBER, IPTC_TYPE_REFERENCE_SERVICE, IPTC_TYPE_RELEASE_DATE, IPTC_TYPE_RELEASE_TIME, IPTC_TYPE_SOURCE, IPTC_TYPE_SPECIAL_INSTRUCTIONS, IPTC_TYPE_SUBJECT_REFERENCE, IPTC_TYPE_SUBLOCATION, IPTC_TYPE_SUPPLEMENTAL_CATEGORY, IPTC_TYPE_TIME_CREATED, IPTC_TYPE_URGENCY, IPTC_TYPE_WRITER_EDITOR, IPTC_TYPES
 
Fields inherited from interface org.apache.sanselan.formats.jpeg.JpegConstants
CONST_8BIM, EOI, EXIF_IDENTIFIER_CODE, icc_profile_label, JFIF0_SIGNATURE, JFIF0_SIGNATURE_ALTERNATIVE, JFIFMarker, JPEG_APP0, JPEG_APP0_Marker, JPEG_APP1_Marker, JPEG_APP13_Marker, JPEG_APP14_Marker, JPEG_APP15_Marker, JPEG_APP2_Marker, MARKERS, MAX_SEGMENT_SIZE, PHOTOSHOP_IDENTIFICATION_STRING, SOF0Marker, SOF10Marker, SOF11Marker, SOF12Marker, SOF13Marker, SOF14Marker, SOF15Marker, SOF1Marker, SOF2Marker, SOF3Marker, SOF4Marker, SOF5Marker, SOF6Marker, SOF7Marker, SOF8Marker, SOF9Marker, SOI, SOS_Marker, XMP_IDENTIFIER
 
Fields inherited from interface org.apache.sanselan.common.BinaryConstants
BYTE_ORDER_BIG_ENDIAN, BYTE_ORDER_INTEL, BYTE_ORDER_LEAST_SIGNIFICANT_BYTE, BYTE_ORDER_LITTLE_ENDIAN, BYTE_ORDER_LSB, BYTE_ORDER_MOST_SIGNIFICANT_BYTE, BYTE_ORDER_MOTOROLA, BYTE_ORDER_MSB, BYTE_ORDER_NETWORK
 
Constructor Summary
JpegIptcRewriter()
           
 
Method Summary
 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(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(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.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 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(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.
 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.
 
Methods inherited from class org.apache.sanselan.formats.jpeg.xmp.JpegRewriter
analyzeJFIF, filterSegments, filterSegments, findPhotoshopApp13Segments, insertAfterLastAppSegments, insertBeforeFirstAppSegments, removeExifSegments, removePhotoshopApp13Segments, removeXmpSegments, writeSegments
 
Methods inherited from class org.apache.sanselan.common.BinaryFileParser
byteArrayHasPrefix, convertByteArrayToInt, convertByteArrayToInt, convertByteArrayToShort, convertByteArrayToShort, getByteOrder, int2ToByteArray, read2Bytes, read3Bytes, read4Bytes, setByteOrder, setByteOrder
 
Methods inherited from class org.apache.sanselan.common.BinaryFileFunctions
CharsToQuad, compareByteArrays, compareByteArrays, compareBytes, compareBytes, convertByteArrayToDouble, convertByteArrayToDouble, convertByteArrayToDoubleArray, convertByteArrayToFloat, convertByteArrayToFloat, convertByteArrayToFloatArray, convertByteArrayToInt, convertByteArrayToInt, convertByteArrayToIntArray, convertByteArrayToRational, convertByteArrayToRational, convertByteArrayToRationalArray, convertByteArrayToShort, convertByteArrayToShort, convertByteArrayToShortArray, convertDoubleArrayToByteArray, convertDoubleToByteArray, convertFloatArrayToByteArray, convertFloatToByteArray, convertIntArrayToByteArray, convertIntArrayToRationalArray, convertRationalArrayToByteArray, convertRationalToByteArray, convertShortArrayToByteArray, convertShortToByteArray, copyStreamToStream, debugByteArray, debugNumber, debugNumber, debugNumber, debugNumber, debugNumberArray, findNull, findNull, getBytearrayHead, getByteArrayTail, getDebug, getRAFBytes, getStreamBytes, head, int2ToByteArray, printByteBits, printCharQuad, printCharQuad, read2Bytes, read3Bytes, read4Bytes, readAndVerifyBytes, readAndVerifyBytes, readByte, readBytearray, readByteArray, readByteArray, readBytes, readRandomBytes, scanForByte, setDebug, skipBytes, skipBytes, slice, startsWith, tail, writeIntInToByteArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JpegIptcRewriter

public JpegIptcRewriter()
Method Detail

removeIPTC

public void removeIPTC(java.io.File src,
                       java.io.OutputStream os)
                throws ImageReadException,
                       java.io.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
java.io.IOException
ImageWriteException
See Also:
File, OutputStream

removeIPTC

public void removeIPTC(byte[] src,
                       java.io.OutputStream os)
                throws ImageReadException,
                       java.io.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
java.io.IOException
ImageWriteException

removeIPTC

public void removeIPTC(java.io.InputStream src,
                       java.io.OutputStream os)
                throws ImageReadException,
                       java.io.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
java.io.IOException
ImageWriteException

removeIPTC

public void removeIPTC(ByteSource byteSource,
                       java.io.OutputStream os)
                throws ImageReadException,
                       java.io.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
java.io.IOException
ImageWriteException

writeIPTC

public void writeIPTC(byte[] src,
                      java.io.OutputStream os,
                      PhotoshopApp13Data newData)
               throws ImageReadException,
                      java.io.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.
xmpXml - String containing IPTC data.
Throws:
ImageReadException
java.io.IOException
ImageWriteException

writeIPTC

public void writeIPTC(java.io.InputStream src,
                      java.io.OutputStream os,
                      PhotoshopApp13Data newData)
               throws ImageReadException,
                      java.io.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 - InputStream containing Jpeg image data.
os - OutputStream to write the image to.
xmpXml - String containing IPTC data.
Throws:
ImageReadException
java.io.IOException
ImageWriteException

writeIPTC

public void writeIPTC(java.io.File src,
                      java.io.OutputStream os,
                      PhotoshopApp13Data newData)
               throws ImageReadException,
                      java.io.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.
xmpXml - String containing IPTC data.
Throws:
ImageReadException
java.io.IOException
ImageWriteException

writeIPTC

public void writeIPTC(ByteSource byteSource,
                      java.io.OutputStream os,
                      PhotoshopApp13Data newData)
               throws ImageReadException,
                      java.io.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.
xmpXml - String containing IPTC data.
Throws:
ImageReadException
java.io.IOException
ImageWriteException


Copyright © 2007-2009. All Rights Reserved.