mediautil.image.jpeg
Class Exif

java.lang.Object
  extended by mediautil.gen.BasicIo
      extended by mediautil.image.jpeg.BasicJpegIo
          extended by mediautil.image.jpeg.AbstractImageInfo<LLJTran>
              extended by mediautil.image.jpeg.Exif
All Implemented Interfaces:
Serializable, MediaInfo
Direct Known Subclasses:
TiffExif

public class Exif
extends AbstractImageInfo<LLJTran>

This class represent the Exif header providing additional information about image. It is organized in a similiar IFD directory structure as specified by the Exif spec.

The below shows the most common usage of creating and changing an Exif Entry:

      // Use appropriate code to read an image into llj
      LLJTran llj = new LLJTran(..); llj.read(..);
      Exif exif = (Exif) llj.getImageInfo();

      // Create and entry for the EXIFIMAGEWIDTH tag
      // LONG is the appropriate Data Type for the EXIFIMAGEWIDTH tag
      Entry e = new Entry(LONG);
      e.setValue(0, new Integer(llj.getWidth()));
      exif.setTagValue(Exif.EXIFIMAGEWIDTH, 0, e, true);

      // Change the value of the DATETIME Entry 
      Entry entry = exif.getTagValue(Exif.DATETIME, true);
      if(entry != null)
          entry.setValue(0, "1998:08:18 11:15:00");
Also go through the below sources whose help was used to build this class:

See Also:
setTagValue(int,int,Entry,boolean), Entry.setValue(int,Object), Serialized Form

Field Summary
static int APERTUREVALUE
          Identifies the APERTUREVALUE tag
static int ARTIST
          Identifies the ARTIST tag
static int ASCII
          Identifies the ASCII Data Type
static int BATTERYLEVEL
          Identifies the BATTERYLEVEL tag
static int BITSPERSAMPLE
          Identifies the BITSPERSAMPLE tag
static int BRIGHTNESSVALUE
          Identifies the BRIGHTNESSVALUE tag
static int BYTE
          Identifies the Byte Data Type
static int CFAPATTERN
          Identifies the CFAPATTERN tag
static int CFAREPEATPATTERNDIM
          Identifies the CFAREPEATPATTERNDIM tag
static int COLORSPACE
          Identifies the COLORSPACE tag
static int COMPONENTSCONFIGURATION
          Identifies the COMPONENTSCONFIGURATION tag
static int COMPRESSEDBITSPERPIXEL
          Identifies the COMPRESSEDBITSPERPIXEL tag
static int COMPRESSION
          Identifies the COMPRESSION tag
static int CONTRAST
          Identifies the CONTRAST tag
static int COPYRIGHT
          Identifies the COPYRIGHT tag
static int CUSTOMRENDERED
          Identifies the CUSTOMRENDERED tag
static int DATETIME
          Identifies the DATETIME tag
static int DATETIMEDIGITIZED
          Identifies the DATETIMEDIGITIZED tag
static int DATETIMEORIGINAL
          Identifies the DATETIMEORIGINAL tag
static int DIGITALZOOMRATIO
          Identifies the DIGITALZOOMRATIO tag
static int DOCUMENTNAME
          Identifies the DOCUMENTNAME tag
static byte[] EXIF_MARK
           
static int EXIFIMAGELENGTH
          Identifies the EXIFIMAGELENGTH tag
static int EXIFIMAGEWIDTH
          Identifies the EXIFIMAGEWIDTH tag
static int EXIFOFFSET
          Identifies the EXIFOFFSET tag
static int EXIFVERSION
          Identifies the EXIFVERSION tag
static String[] EXPOSURE_PROGRAMS
           
static int EXPOSUREBIASVALUE
          Identifies the EXPOSUREBIASVALUE tag
static int EXPOSUREINDEX
          Identifies the EXPOSUREINDEX tag
static int EXPOSUREMODE
          Identifies the EXPOSUREMODE tag
static int EXPOSUREPROGRAM
          Identifies the EXPOSUREPROGRAM tag
static int EXPOSURETIME
          Identifies the EXPOSURETIME tag
static int FILESOURCE
          Identifies the FILESOURCE tag
static int FILLORDER
          Identifies the FILLORDER tag
static int FLASH
          Identifies the FLASH tag
static int FLASHENERGY
          Identifies the FLASHENERGY tag
static int FLASHPIXVERSION
          Identifies the FLASHPIXVERSION tag
static int FNUMBER
          Identifies the FNUMBER tag
static int FOCALLENGTH
          Identifies the FOCALLENGTH tag
static int FOCALLENGTHIN35MMFILM
          Identifies the FOCALLENGTHIN35MMFILM tag
static int FOCALPLANERESOLUTIONUNIT
          Identifies the FOCALPLANERESOLUTIONUNIT tag
static int FOCALPLANEXRESOLUTION
          Identifies the FOCALPLANEXRESOLUTION tag
static int FOCALPLANEYRESOLUTION
          Identifies the FOCALPLANEYRESOLUTION tag
static String FORMAT
           
static int GAINCONTROL
          Identifies the GAINCONTROL tag
static int GPSINFO
          Identifies the GPSINFO tag
static int IMAGEDESCRIPTION
          Identifies the IMAGEDESCRIPTION tag
static int IMAGELENGTH
          Identifies the IMAGELENGTH tag
static int IMAGEWIDTH
          Identifies the IMAGEWIDTH tag
static int INTERCOLORPROFILE
          Identifies the ERCOLORPROFILE tag
static int INTEROPERABILITYOFFSET
          Identifies the EROPERABILITYOFFSET tag
static int IPTC_NAA
          Identifies the IPTC_NAA tag
static int ISOSPEEDRATINGS
          Identifies the ISOSPEEDRATINGS tag
static int JPEGINTERCHANGEFORMAT
          Identifies the JPEGINTERCHANGEFORMAT tag
static int JPEGINTERCHANGEFORMATLENGTH
          Identifies the JPEGINTERCHANGEFORMATLENGTH tag
static int JPEGPROC
          Identifies the JPEGPROC tag
static int JPEGTABLES
          Identifies the JPEGTABLES tag
static int LIGHTSOURCE
          Identifies the LIGHTSOURCE tag
static int LONG
          Identifies the LONG Data Type
static int MAKE
          Identifies the MAKE tag
static int MAKERNOTE
          Identifies the MAKERNOTE tag
static int MAXAPERTUREVALUE
          Identifies the MAXAPERTUREVALUE tag
static String[] METERING_MODES
           
static int METERINGMODE
          Identifies the METERINGMODE tag
static int MODEL
          Identifies the MODEL tag
static int NEWSUBFILETYPE
          Identifies NEWSUBFILETYPE tag
static int OECF
          Identifies the OECF tag
static int[] opToCorrectOrientation
          A lookup array which can be used to get the LLJTran transformation operation required to correct the orientation for a given Exif Orientation Tag
static int ORIENTATION
          Identifies the ORIENTATION tag
static int ORIENTATION_BOTLEFT
           
static int ORIENTATION_BOTRIGHT
           
static int ORIENTATION_LEFTBOT
           
static int ORIENTATION_LEFTTOP
           
static int ORIENTATION_RIGHTBOT
           
static int ORIENTATION_RIGHTTOP
           
static int ORIENTATION_TOPLEFT
           
static int ORIENTATION_TOPRIGHT
           
static int PHOTOMETRICINTERPRETATION
          Identifies the PHOTOMETRICINTERPRETATION tag
static int PLANARCONFIGURATION
          Identifies the PLANARCONFIGURATION tag
static int PRIMARYCHROMATICITIES
          Identifies the PRIMARYCHROMATICITIES tag
static int PRINTMODE
          Identifies the PRINTMODE tag
static int RATIONAL
          Identifies the RATIONAL Data Type
static int REFERENCEBLACKWHITE
          Identifies the REFERENCEBLACKWHITE tag
static int RESOLUTIONUNIT
          Identifies the RESOLUTIONUNIT tag
static int ROWSPERSTRIP
          Identifies the ROWSPERSTRIP tag
static int SAMPLESPERPIXEL
          Identifies the SAMPLESPERPIXEL tag
static int SATURATION
          Identifies the SATURATION tag
static int SBYTE
          Identifies the Signed BYTE Data Type
static int SCENECAPTURETYPE
          Identifies the SCENECAPTURETYPE tag
static int SCENETYPE
          Identifies the SCENETYPE tag
static int SENSINGMETHOD
          Identifies the SENSINGMETHOD tag
static int SHARPNESS
          Identifies the SHARPNESS tag
static int SHORT
          Identifies the SHORT Data Type
static int SHUTTERSPEEDVALUE
          Identifies the SHUTTERSPEEDVALUE tag
static int SLONG
          Identifies the Signed LONG Data Type
static int SOFTWARE
          Identifies the SOFTWARE tag
static int SPATIALFREQUENCYRESPONSE
          Identifies the SPATIALFREQUENCYRESPONSE tag
static int SPECTRALSENSITIVITY
          Identifies the SPECTRALSENSITIVITY tag
static int SRATIONAL
          Identifies the Signed RATIONAL Data Type
static int SSHORT
          Identifies the Signed SHORT Data Type
static int STRIPBYTECOUNTS
          Identifies the STRIPBYTECOUNTS tag
static int STRIPOFFSETS
          Identifies the STRIPOFFSETS tag
static int SUBIFDS
          Identifies the SUBIFDS tag
static int SUBJECTDISTANCE
          Identifies the SUBJECTDISTANCE tag
static int SUBJECTLOCATION
          Identifies the SUBJECTLOCATION tag
static int SUBSECTIME
          Identifies the SUBSECTIME tag
static int SUBSECTIMEDIGITIZED
          Identifies the SUBSECTIMEDIGITIZED tag
static int SUBSECTIMEORIGINAL
          Identifies the SUBSECTIMEORIGINAL tag
static int TRANSFERFUNCTION
          Identifies the TRANSFERFUNCTION tag
static int TRANSFERRANGE
          Identifies the TRANSFERRANGE tag
static int[] TYPELENGTH
           
static int UNDEFINED
          Identifies the UNDEFINED Data Type
static int USERCOMMENT
          Identifies the USERCOMMENT tag
static int WHITEBALANCE
          Identifies the WHITEBALANCE tag
static int WHITEPOINT
          Identifies the WHITEPOINT tag
static int XRESOLUTION
          Identifies the XRESOLUTION tag
static int YCBCRCOEFFICIENTS
          Identifies the YCBCRCOEFFICIENTS tag
static int YCBCRPOSITIONING
          Identifies the YCBCRPOSITIONING tag
static int YCBCRSUBSAMPLING
          Identifies the YCBCRSUBSAMPLING tag
static int YRESOLUTION
          Identifies the YRESOLUTION tag
 
Fields inherited from class mediautil.image.jpeg.AbstractImageInfo
AV_TO_FSTOP, BMP_SIG, BMP24_HDR_SIZE, dateformat, DEFAULT_THUMB_SIZE, fnumberformat, NA, TV_TO_SEC
 
Fields inherited from class mediautil.image.jpeg.BasicJpegIo
M_DHP, M_DHT, M_DNL, M_DQT, M_DRI, M_EXP
 
Fields inherited from class mediautil.gen.BasicIo
FACTOR_ABVS
 
Fields inherited from interface mediautil.gen.MediaInfo
ALBUM, APERTURE, ARTISTWEBPAGE, AUDIOFILEWEBPAGE, AUDIOSOURCEWEBPAGE, BAND, BITRATE, BPM, CDIDENTIFIER, CLASS_AUDIO, CLASS_IMAGE, CLASS_VIDEO, COMMENTS, COMMERCIAL, COMMERCIALINFORMATION, COMPILATION, COMPOSER, CONDUCTOR, CONTENTGROUP, COPYRIGHTTEXT, COPYRIGHTWEBPAGE, DATE, DATETIMEORIGINALSTRING, EMPHASIS, ENCAPSULATEDOBJECT, ENCODEDBY, ENCRYPTIONMETHODREGISTRATION, EQUALISATION, ESS_CHARACHTER, ESS_MAKE, ESS_QUALITY, ESS_TIMESTAMP, EVENTTIMINGCODES, EXPOPROGRAM, FILEOWNER, FILESIZE, FILETYPE, GENRE, GROUPIDENTIFICATIONREGISTRATION, INITIALKEY, INTERNETRADIOSTATIONNAME, INTERNETRADIOSTATIONOWNER, INTERNETRADIOSTATIONWEBPAGE, ISRC, LANGUAGE, LASTMODIFIED, LASTPLAY, LAYER, LENGTH, LENGTHINTAG, LOOKUPTABLE, LYRICIST, MEDIA_ATTRIBUTES, MEDIATYPE, METERING, MODE, MPEGLEVEL, OFTRACKS, ORIGINAL, ORIGINALARTIST, ORIGINALFILENAME, ORIGINALLYRICIST, ORIGINALTITLE, ORIGINALYEAR, OWNERSHIP, PARTOFSET, PAYMENTWEBPAGE, PICTURE, PICTURE_ATTRIBUTES, PLAY_ATTRIBUTES, PLAYCOUNTER, PLAYLISTDELAY, POPULARIMETER, PRIVATE, PRIVATEDATA, PROTECTION, PUBLISHER, PUBLISHERSWEBPAGE, QUALITY, RATING, RECORDINGDATES, RELATIVEVOLUMENADJUSTMENT, REMIXER, RESOLUTIONX, RESOLUTIONY, REVERB, SAMPLERATE, SHUTTER, SUBTITLE, TERMSOFUSE, THUMBNAIL, TIME, TITLE, TRACK, UNIQUEFILEIDENTIFIER, USERDEFINEDTEXT, VBR, YEAR
 
Constructor Summary
Exif()
          Basic constructor
Exif(InputStream is, byte[] data, int offset, String name, String comments, LLJTran format)
          Loads the ImageInfo using information supplied.
 
Method Summary
 String getDataTimeOriginalString()
           
 int getExpoProgram()
           
 String getExpoProgramAsString()
           
 float getFNumber()
           
 float getFocalLength()
           
 String getFormat()
           
 IFD[] getIFDs()
          return IFDs
 String getMake()
           
static byte[] getMarkerData()
           
 int getMetering()
           
 String getMeteringAsString()
           
 String getModel()
           
 String getOrientation()
           
 String getQuality()
           
 String getReport()
           
 int getResolutionX()
           
 int getResolutionY()
           
 Rational getShutter()
           
 Entry getTagValue(int tag, boolean main)
          Gets the Entry corresponding to an Exif tag.
 Entry getTagValue(Integer tag, int subTag, boolean main)
          Gets the Entry corresponding to an Exif tag.
 String getThumbnailExtension()
          Gets the extension of the Thumbnail Image format.
 Icon getThumbnailIcon(Dimension size)
           
 int getThumbnailLength()
          Method to get the length of the Thumnail.
 int getThumbnailOffset()
          Method to get the offset of the Thumbnail within the imageInfo data.
 boolean isFlash()
           
 void readInfo()
          Reads the imageInfo from the Input supplied in Constructor.
 boolean removeThumbnailTags()
          Removes the Thumbnail Tags in the imageInfo.
 boolean saveThumbnailImage(OutputStream os)
          saves thumbnail image to specified path
 void setResolutionX(int xRes)
          Sets Exif Image Width
 void setResolutionY(int yRes)
          Sets Exif Image Height
 void setTagValue(int tag, int subTag, Entry value, boolean main)
          Sets the Entry corresponding to an Exif tag.
 void setThumbnail(byte[] newThumbnailData, int startIndex, int len, String thumbnailExt, OutputStream newExifOp)
          Method to write the imageInfo with a new Thumbnail.
static int transformOrientationTag(int tag, int op)
          Returns the new Orientation Tag after applying a transformation.
 void writeInfo(byte[] markerData, OutputStream out, int op, int options, boolean modifyImageInfo, int imageWidth, int imageHeight, String encoding)
          Writes modified or not Exif to out.
 
Methods inherited from class mediautil.image.jpeg.AbstractImageInfo
apertureToFnumber, getAdvancedImage, getAttribute, getBoolAttribute, getComments, getDateTimeOriginal, getDoubleAttribute, getFiveMajorAttributes, getFloatAttribute, getImageFile, getIntAttribute, getLongAttribute, getName, getThumbnailIcon, setAdvancedImage, setAttribute, setName, toString, writeInfo, writeInfo
 
Methods inherited from class mediautil.gen.BasicIo
asInt, asString, bn2s, bn2s, convertLength, in2s, isSignature, read, read, s2n, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FORMAT

public static final String FORMAT
See Also:
Constant Field Values

EXIF_MARK

public static final byte[] EXIF_MARK

NEWSUBFILETYPE

public static final int NEWSUBFILETYPE
Identifies NEWSUBFILETYPE tag

See Also:
Constant Field Values

IMAGEWIDTH

public static final int IMAGEWIDTH
Identifies the IMAGEWIDTH tag

See Also:
Constant Field Values

IMAGELENGTH

public static final int IMAGELENGTH
Identifies the IMAGELENGTH tag

See Also:
Constant Field Values

BITSPERSAMPLE

public static final int BITSPERSAMPLE
Identifies the BITSPERSAMPLE tag

See Also:
Constant Field Values

COMPRESSION

public static final int COMPRESSION
Identifies the COMPRESSION tag

See Also:
Constant Field Values

PHOTOMETRICINTERPRETATION

public static final int PHOTOMETRICINTERPRETATION
Identifies the PHOTOMETRICINTERPRETATION tag

See Also:
Constant Field Values

FILLORDER

public static final int FILLORDER
Identifies the FILLORDER tag

See Also:
Constant Field Values

DOCUMENTNAME

public static final int DOCUMENTNAME
Identifies the DOCUMENTNAME tag

See Also:
Constant Field Values

IMAGEDESCRIPTION

public static final int IMAGEDESCRIPTION
Identifies the IMAGEDESCRIPTION tag

See Also:
Constant Field Values

MAKE

public static final int MAKE
Identifies the MAKE tag

See Also:
Constant Field Values

MODEL

public static final int MODEL
Identifies the MODEL tag

See Also:
Constant Field Values

STRIPOFFSETS

public static final int STRIPOFFSETS
Identifies the STRIPOFFSETS tag

See Also:
Constant Field Values

ORIENTATION

public static final int ORIENTATION
Identifies the ORIENTATION tag

See Also:
Constant Field Values

SAMPLESPERPIXEL

public static final int SAMPLESPERPIXEL
Identifies the SAMPLESPERPIXEL tag

See Also:
Constant Field Values

ROWSPERSTRIP

public static final int ROWSPERSTRIP
Identifies the ROWSPERSTRIP tag

See Also:
Constant Field Values

STRIPBYTECOUNTS

public static final int STRIPBYTECOUNTS
Identifies the STRIPBYTECOUNTS tag

See Also:
Constant Field Values

XRESOLUTION

public static final int XRESOLUTION
Identifies the XRESOLUTION tag

See Also:
Constant Field Values

YRESOLUTION

public static final int YRESOLUTION
Identifies the YRESOLUTION tag

See Also:
Constant Field Values

PLANARCONFIGURATION

public static final int PLANARCONFIGURATION
Identifies the PLANARCONFIGURATION tag

See Also:
Constant Field Values

RESOLUTIONUNIT

public static final int RESOLUTIONUNIT
Identifies the RESOLUTIONUNIT tag

See Also:
Constant Field Values

TRANSFERFUNCTION

public static final int TRANSFERFUNCTION
Identifies the TRANSFERFUNCTION tag

See Also:
Constant Field Values

SOFTWARE

public static final int SOFTWARE
Identifies the SOFTWARE tag

See Also:
Constant Field Values

DATETIME

public static final int DATETIME
Identifies the DATETIME tag

See Also:
Constant Field Values

ARTIST

public static final int ARTIST
Identifies the ARTIST tag

See Also:
Constant Field Values

WHITEPOINT

public static final int WHITEPOINT
Identifies the WHITEPOINT tag

See Also:
Constant Field Values

PRIMARYCHROMATICITIES

public static final int PRIMARYCHROMATICITIES
Identifies the PRIMARYCHROMATICITIES tag

See Also:
Constant Field Values

SUBIFDS

public static final int SUBIFDS
Identifies the SUBIFDS tag

See Also:
Constant Field Values

JPEGTABLES

public static final int JPEGTABLES
Identifies the JPEGTABLES tag

See Also:
Constant Field Values

TRANSFERRANGE

public static final int TRANSFERRANGE
Identifies the TRANSFERRANGE tag

See Also:
Constant Field Values

JPEGPROC

public static final int JPEGPROC
Identifies the JPEGPROC tag

See Also:
Constant Field Values

JPEGINTERCHANGEFORMAT

public static final int JPEGINTERCHANGEFORMAT
Identifies the JPEGINTERCHANGEFORMAT tag

See Also:
Constant Field Values

JPEGINTERCHANGEFORMATLENGTH

public static final int JPEGINTERCHANGEFORMATLENGTH
Identifies the JPEGINTERCHANGEFORMATLENGTH tag

See Also:
Constant Field Values

YCBCRCOEFFICIENTS

public static final int YCBCRCOEFFICIENTS
Identifies the YCBCRCOEFFICIENTS tag

See Also:
Constant Field Values

YCBCRSUBSAMPLING

public static final int YCBCRSUBSAMPLING
Identifies the YCBCRSUBSAMPLING tag

See Also:
Constant Field Values

YCBCRPOSITIONING

public static final int YCBCRPOSITIONING
Identifies the YCBCRPOSITIONING tag

See Also:
Constant Field Values

REFERENCEBLACKWHITE

public static final int REFERENCEBLACKWHITE
Identifies the REFERENCEBLACKWHITE tag

See Also:
Constant Field Values

CFAREPEATPATTERNDIM

public static final int CFAREPEATPATTERNDIM
Identifies the CFAREPEATPATTERNDIM tag

See Also:
Constant Field Values

CFAPATTERN

public static final int CFAPATTERN
Identifies the CFAPATTERN tag

See Also:
Constant Field Values

BATTERYLEVEL

public static final int BATTERYLEVEL
Identifies the BATTERYLEVEL tag

See Also:
Constant Field Values

COPYRIGHT

public static final int COPYRIGHT
Identifies the COPYRIGHT tag

See Also:
Constant Field Values

EXPOSURETIME

public static final int EXPOSURETIME
Identifies the EXPOSURETIME tag

See Also:
Constant Field Values

FNUMBER

public static final int FNUMBER
Identifies the FNUMBER tag

See Also:
Constant Field Values

IPTC_NAA

public static final int IPTC_NAA
Identifies the IPTC_NAA tag

See Also:
Constant Field Values

EXIFOFFSET

public static final int EXIFOFFSET
Identifies the EXIFOFFSET tag

See Also:
Constant Field Values

INTERCOLORPROFILE

public static final int INTERCOLORPROFILE
Identifies the ERCOLORPROFILE tag

See Also:
Constant Field Values

EXPOSUREPROGRAM

public static final int EXPOSUREPROGRAM
Identifies the EXPOSUREPROGRAM tag

See Also:
Constant Field Values

SPECTRALSENSITIVITY

public static final int SPECTRALSENSITIVITY
Identifies the SPECTRALSENSITIVITY tag

See Also:
Constant Field Values

GPSINFO

public static final int GPSINFO
Identifies the GPSINFO tag

See Also:
Constant Field Values

ISOSPEEDRATINGS

public static final int ISOSPEEDRATINGS
Identifies the ISOSPEEDRATINGS tag

See Also:
Constant Field Values

OECF

public static final int OECF
Identifies the OECF tag

See Also:
Constant Field Values

EXIFVERSION

public static final int EXIFVERSION
Identifies the EXIFVERSION tag

See Also:
Constant Field Values

DATETIMEORIGINAL

public static final int DATETIMEORIGINAL
Identifies the DATETIMEORIGINAL tag

See Also:
Constant Field Values

DATETIMEDIGITIZED

public static final int DATETIMEDIGITIZED
Identifies the DATETIMEDIGITIZED tag

See Also:
Constant Field Values

COMPONENTSCONFIGURATION

public static final int COMPONENTSCONFIGURATION
Identifies the COMPONENTSCONFIGURATION tag

See Also:
Constant Field Values

COMPRESSEDBITSPERPIXEL

public static final int COMPRESSEDBITSPERPIXEL
Identifies the COMPRESSEDBITSPERPIXEL tag

See Also:
Constant Field Values

SHUTTERSPEEDVALUE

public static final int SHUTTERSPEEDVALUE
Identifies the SHUTTERSPEEDVALUE tag

See Also:
Constant Field Values

APERTUREVALUE

public static final int APERTUREVALUE
Identifies the APERTUREVALUE tag

See Also:
Constant Field Values

BRIGHTNESSVALUE

public static final int BRIGHTNESSVALUE
Identifies the BRIGHTNESSVALUE tag

See Also:
Constant Field Values

EXPOSUREBIASVALUE

public static final int EXPOSUREBIASVALUE
Identifies the EXPOSUREBIASVALUE tag

See Also:
Constant Field Values

MAXAPERTUREVALUE

public static final int MAXAPERTUREVALUE
Identifies the MAXAPERTUREVALUE tag

See Also:
Constant Field Values

SUBJECTDISTANCE

public static final int SUBJECTDISTANCE
Identifies the SUBJECTDISTANCE tag

See Also:
Constant Field Values

METERINGMODE

public static final int METERINGMODE
Identifies the METERINGMODE tag

See Also:
Constant Field Values

LIGHTSOURCE

public static final int LIGHTSOURCE
Identifies the LIGHTSOURCE tag

See Also:
Constant Field Values

FLASH

public static final int FLASH
Identifies the FLASH tag

See Also:
Constant Field Values

FOCALLENGTH

public static final int FOCALLENGTH
Identifies the FOCALLENGTH tag

See Also:
Constant Field Values

MAKERNOTE

public static final int MAKERNOTE
Identifies the MAKERNOTE tag

See Also:
Constant Field Values

USERCOMMENT

public static final int USERCOMMENT
Identifies the USERCOMMENT tag

See Also:
Constant Field Values

SUBSECTIME

public static final int SUBSECTIME
Identifies the SUBSECTIME tag

See Also:
Constant Field Values

SUBSECTIMEORIGINAL

public static final int SUBSECTIMEORIGINAL
Identifies the SUBSECTIMEORIGINAL tag

See Also:
Constant Field Values

SUBSECTIMEDIGITIZED

public static final int SUBSECTIMEDIGITIZED
Identifies the SUBSECTIMEDIGITIZED tag

See Also:
Constant Field Values

FLASHPIXVERSION

public static final int FLASHPIXVERSION
Identifies the FLASHPIXVERSION tag

See Also:
Constant Field Values

COLORSPACE

public static final int COLORSPACE
Identifies the COLORSPACE tag

See Also:
Constant Field Values

EXIFIMAGEWIDTH

public static final int EXIFIMAGEWIDTH
Identifies the EXIFIMAGEWIDTH tag

See Also:
Constant Field Values

EXIFIMAGELENGTH

public static final int EXIFIMAGELENGTH
Identifies the EXIFIMAGELENGTH tag

See Also:
Constant Field Values

INTEROPERABILITYOFFSET

public static final int INTEROPERABILITYOFFSET
Identifies the EROPERABILITYOFFSET tag

See Also:
Constant Field Values

FLASHENERGY

public static final int FLASHENERGY
Identifies the FLASHENERGY tag

See Also:
Constant Field Values

SPATIALFREQUENCYRESPONSE

public static final int SPATIALFREQUENCYRESPONSE
Identifies the SPATIALFREQUENCYRESPONSE tag

See Also:
Constant Field Values

FOCALPLANEXRESOLUTION

public static final int FOCALPLANEXRESOLUTION
Identifies the FOCALPLANEXRESOLUTION tag

See Also:
Constant Field Values

FOCALPLANEYRESOLUTION

public static final int FOCALPLANEYRESOLUTION
Identifies the FOCALPLANEYRESOLUTION tag

See Also:
Constant Field Values

FOCALPLANERESOLUTIONUNIT

public static final int FOCALPLANERESOLUTIONUNIT
Identifies the FOCALPLANERESOLUTIONUNIT tag

See Also:
Constant Field Values

SUBJECTLOCATION

public static final int SUBJECTLOCATION
Identifies the SUBJECTLOCATION tag

See Also:
Constant Field Values

EXPOSUREINDEX

public static final int EXPOSUREINDEX
Identifies the EXPOSUREINDEX tag

See Also:
Constant Field Values

SENSINGMETHOD

public static final int SENSINGMETHOD
Identifies the SENSINGMETHOD tag

See Also:
Constant Field Values

FILESOURCE

public static final int FILESOURCE
Identifies the FILESOURCE tag

See Also:
Constant Field Values

SCENETYPE

public static final int SCENETYPE
Identifies the SCENETYPE tag

See Also:
Constant Field Values

FOCALLENGTHIN35MMFILM

public static final int FOCALLENGTHIN35MMFILM
Identifies the FOCALLENGTHIN35MMFILM tag

See Also:
Constant Field Values

SHARPNESS

public static final int SHARPNESS
Identifies the SHARPNESS tag

See Also:
Constant Field Values

CUSTOMRENDERED

public static final int CUSTOMRENDERED
Identifies the CUSTOMRENDERED tag

See Also:
Constant Field Values

EXPOSUREMODE

public static final int EXPOSUREMODE
Identifies the EXPOSUREMODE tag

See Also:
Constant Field Values

WHITEBALANCE

public static final int WHITEBALANCE
Identifies the WHITEBALANCE tag

See Also:
Constant Field Values

DIGITALZOOMRATIO

public static final int DIGITALZOOMRATIO
Identifies the DIGITALZOOMRATIO tag

See Also:
Constant Field Values

SATURATION

public static final int SATURATION
Identifies the SATURATION tag

See Also:
Constant Field Values

SCENECAPTURETYPE

public static final int SCENECAPTURETYPE
Identifies the SCENECAPTURETYPE tag

See Also:
Constant Field Values

GAINCONTROL

public static final int GAINCONTROL
Identifies the GAINCONTROL tag

See Also:
Constant Field Values

CONTRAST

public static final int CONTRAST
Identifies the CONTRAST tag

See Also:
Constant Field Values

PRINTMODE

public static final int PRINTMODE
Identifies the PRINTMODE tag

See Also:
Constant Field Values

BYTE

public static final int BYTE
Identifies the Byte Data Type

See Also:
Constant Field Values

ASCII

public static final int ASCII
Identifies the ASCII Data Type

See Also:
Constant Field Values

SHORT

public static final int SHORT
Identifies the SHORT Data Type

See Also:
Constant Field Values

LONG

public static final int LONG
Identifies the LONG Data Type

See Also:
Constant Field Values

RATIONAL

public static final int RATIONAL
Identifies the RATIONAL Data Type

See Also:
Constant Field Values

SBYTE

public static final int SBYTE
Identifies the Signed BYTE Data Type

See Also:
Constant Field Values

UNDEFINED

public static final int UNDEFINED
Identifies the UNDEFINED Data Type

See Also:
Constant Field Values

SSHORT

public static final int SSHORT
Identifies the Signed SHORT Data Type

See Also:
Constant Field Values

SLONG

public static final int SLONG
Identifies the Signed LONG Data Type

See Also:
Constant Field Values

SRATIONAL

public static final int SRATIONAL
Identifies the Signed RATIONAL Data Type

See Also:
Constant Field Values

ORIENTATION_TOPLEFT

public static final int ORIENTATION_TOPLEFT
See Also:
Constant Field Values

ORIENTATION_TOPRIGHT

public static final int ORIENTATION_TOPRIGHT
See Also:
Constant Field Values

ORIENTATION_BOTRIGHT

public static final int ORIENTATION_BOTRIGHT
See Also:
Constant Field Values

ORIENTATION_BOTLEFT

public static final int ORIENTATION_BOTLEFT
See Also:
Constant Field Values

ORIENTATION_LEFTTOP

public static final int ORIENTATION_LEFTTOP
See Also:
Constant Field Values

ORIENTATION_RIGHTTOP

public static final int ORIENTATION_RIGHTTOP
See Also:
Constant Field Values

ORIENTATION_RIGHTBOT

public static final int ORIENTATION_RIGHTBOT
See Also:
Constant Field Values

ORIENTATION_LEFTBOT

public static final int ORIENTATION_LEFTBOT
See Also:
Constant Field Values

EXPOSURE_PROGRAMS

public static final String[] EXPOSURE_PROGRAMS

METERING_MODES

public static final String[] METERING_MODES

TYPELENGTH

public static final int[] TYPELENGTH

opToCorrectOrientation

public static final int[] opToCorrectOrientation
A lookup array which can be used to get the LLJTran transformation operation required to correct the orientation for a given Exif Orientation Tag

Constructor Detail

Exif

public Exif(InputStream is,
            byte[] data,
            int offset,
            String name,
            String comments,
            LLJTran format)
     throws FileFormatException
Loads the ImageInfo using information supplied. Uses the readInfo() method through AbstractImageInfo's constructor.

Parameters:
is - Image input. This is not used by Exif.
data - Image Header Information Marker Data excluding the 4 jpeg marker bytes
offset - Offset of marker within Image Input
name - Name of the Image File
comments - Image comments
format - Image Object of type LLJTran
Throws:
FileFormatException

Exif

public Exif()
Basic constructor

Method Detail

getFormat

public String getFormat()
Specified by:
getFormat in class AbstractImageInfo<LLJTran>

getMarkerData

public static byte[] getMarkerData()

getTagValue

public Entry getTagValue(int tag,
                         boolean main)
Gets the Entry corresponding to an Exif tag.

Parameters:
tag - Exif tag
main - true if it is in the main IFD, false if it is in the Sub IFD. Most of the commonly used Exif tags are in the main IFD. The Thumbnail related tags are in the Sub IFD.
Returns:
Entry corresponding to the tag

getTagValue

public Entry getTagValue(Integer tag,
                         int subTag,
                         boolean main)
Gets the Entry corresponding to an Exif tag.

Parameters:
tag - Exif tag
subTag - Sub Tag if any or pass -1
main - true if it is in the main IFD, false if it is in the Sub IFD. Most of the commonly used Exif tags are in the main IFD. The Thumbnail related tags are in the Sub IFD.
Returns:
Entry corresponding to the tag

setTagValue

public void setTagValue(int tag,
                        int subTag,
                        Entry value,
                        boolean main)
Sets the Entry corresponding to an Exif tag.

Parameters:
tag - Exif tag
subTag - Sub Tag if any or pass -1
value - Entry to set
main - true if it is in the main IFD, false if it is in the Sub IFD. Most of the commonly used Exif tags are in the main IFD. The Thumbnail related tags are in the Sub IFD.

getThumbnailLength

public int getThumbnailLength()
Method to get the length of the Thumnail.

Overrides:
getThumbnailLength in class AbstractImageInfo<LLJTran>
Returns:
Length of the Thumnail

getThumbnailOffset

public int getThumbnailOffset()
Method to get the offset of the Thumbnail within the imageInfo data.

Overrides:
getThumbnailOffset in class AbstractImageInfo<LLJTran>
Returns:
Offset of the Thumnail within the Appx marker data

saveThumbnailImage

public boolean saveThumbnailImage(OutputStream os)
                           throws IOException
saves thumbnail image to specified path

Overrides:
saveThumbnailImage in class AbstractImageInfo<LLJTran>
Throws:
IOException

getThumbnailExtension

public String getThumbnailExtension()
Gets the extension of the Thumbnail Image format. Returns null if the image has no Thumbnail.

Overrides:
getThumbnailExtension in class AbstractImageInfo<LLJTran>
Returns:
Thumbnail Extension as defined in ImageResources
See Also:
ImageResources

getThumbnailIcon

public Icon getThumbnailIcon(Dimension size)
Specified by:
getThumbnailIcon in class AbstractImageInfo<LLJTran>

getResolutionX

public int getResolutionX()
Specified by:
getResolutionX in class AbstractImageInfo<LLJTran>
Returns:
Exif Image Width

setResolutionX

public void setResolutionX(int xRes)
Sets Exif Image Width

Parameters:
xRes - x Resolution

getResolutionY

public int getResolutionY()
Specified by:
getResolutionY in class AbstractImageInfo<LLJTran>
Returns:
Exif Image Height

setResolutionY

public void setResolutionY(int yRes)
Sets Exif Image Height

Parameters:
yRes - y Resolution

getMetering

public int getMetering()
Specified by:
getMetering in class AbstractImageInfo<LLJTran>

getMeteringAsString

public String getMeteringAsString()

getExpoProgram

public int getExpoProgram()
Specified by:
getExpoProgram in class AbstractImageInfo<LLJTran>

getExpoProgramAsString

public String getExpoProgramAsString()

getMake

public String getMake()
Specified by:
getMake in class AbstractImageInfo<LLJTran>

getModel

public String getModel()
Specified by:
getModel in class AbstractImageInfo<LLJTran>

getDataTimeOriginalString

public String getDataTimeOriginalString()
Specified by:
getDataTimeOriginalString in class AbstractImageInfo<LLJTran>

getFNumber

public float getFNumber()
Specified by:
getFNumber in class AbstractImageInfo<LLJTran>

getShutter

public Rational getShutter()
Specified by:
getShutter in class AbstractImageInfo<LLJTran>

isFlash

public boolean isFlash()
Specified by:
isFlash in class AbstractImageInfo<LLJTran>

getFocalLength

public float getFocalLength()
Specified by:
getFocalLength in class AbstractImageInfo<LLJTran>

getQuality

public String getQuality()
Specified by:
getQuality in class AbstractImageInfo<LLJTran>

getOrientation

public String getOrientation()

getReport

public String getReport()
Specified by:
getReport in class AbstractImageInfo<LLJTran>

readInfo

public void readInfo()
Reads the imageInfo from the Input supplied in Constructor.

Specified by:
readInfo in class AbstractImageInfo<LLJTran>

transformOrientationTag

public static int transformOrientationTag(int tag,
                                          int op)
Returns the new Orientation Tag after applying a transformation.

Parameters:
tag - Current Orientation tag
op - Transformation as defined in LLJTran
Returns:
New Orientation tag that should be set after Transforming the image

writeInfo

public void writeInfo(byte[] markerData,
                      OutputStream out,
                      int op,
                      int options,
                      boolean modifyImageInfo,
                      int imageWidth,
                      int imageHeight,
                      String encoding)
               throws IOException
Writes modified or not Exif to out. APP header and its length are not included so any wrapper should do that calculation.

This method is mainly for use by LLJTran to regenerate the Appx marker Data for the imageInfo.

Overrides:
writeInfo in class AbstractImageInfo<LLJTran>
Parameters:
markerData - The existing markerData. This is used by Exif to read the existing Thumbnail.
out - Output Stream to write out the new markerData
op - The transformation option. This is used to switch the width and height in imageInfo if op is a ROT_90 like transform and transform the orientation tag and Thumbnail if opted for.
options - OPT_XFORM_.. options of LLJTran. LLJTran passes its options directly to this method. This uses the imageInfo related flags LLJTran.OPT_XFORM_THUMBNAIL and LLJTran.OPT_XFORM_ORIENTATION and makes the necessary changes to imageInfo depending on the transform specified by op before writing.
modifyImageInfo - If true the changes made to imageInfo are retained, otherwise the state is restored at the end of the call.
imageWidth - Actual Image Width. If this and imageHeight are positive then they are used for the width and height in imageInfo and no switching of width and height is done for ROT_90 like transforms.
imageHeight - Actaul Image Height
encoding - Encoding to be used when for writing out Character information like comments.
Throws:
IOException

setThumbnail

public void setThumbnail(byte[] newThumbnailData,
                         int startIndex,
                         int len,
                         String thumbnailExt,
                         OutputStream newExifOp)
                  throws IOException
Method to write the imageInfo with a new Thumbnail. This method changes the imageInfo for the new Thumbnail and writes out the corresponding Appx header data (without jpeg markers) with the new new Thumbnail.

Overrides:
setThumbnail in class AbstractImageInfo<LLJTran>
Parameters:
newThumbnailData - New Thumbnail image data
startIndex - Offset within newThumbnailData where the image starts
len - Length of Thumbnail Image
thumbnailExt - Extension of the Thumbnail Image from ImageResources which identifies the format of the Thumbnail image. Exif supports only JPEG and BMP formats for Thumbnail.
newExifOp - Output to write out the new Appx data
Throws:
IOException

removeThumbnailTags

public boolean removeThumbnailTags()
Removes the Thumbnail Tags in the imageInfo. Thus the next time the Appx is written using writeInfo(..) it will be without a Thumbnail

Overrides:
removeThumbnailTags in class AbstractImageInfo<LLJTran>
Returns:
True if the Sub IFD containing Thumbnail is present

getIFDs

public IFD[] getIFDs()
return IFDs