ImageEn, unit iexBitmaps

EXIF Overview


EXIF is a common form of meta-data that is embedded in images, typically by digital cameras to provide photographic information.



ImageEn supports EXIF for the following formats (* indicated reading only):
 JPEG
 TIFF
 PNG (from "eXIf", "iTXt", "zTXt" and "tEXt" chunks) *
 PSD
 HDP
 Camera RAW *

If an image contains EXIF data, EXIF_HasEXIFData will be true after loading. Set EXIF_HasEXIFData to true, if you add EXIF data to an image, or set to false to clear EXIF data.


Demo

Demo  Demos\InputOutput\EXIF\EXIF.dpr

General EXIF Tags
Public Property  EXIF_HasEXIFData
Public Property  EXIF_Artist
Public Property  EXIF_Bitmap
Public Property  EXIF_CompressedBitsPerPixel
Public Property  EXIF_Copyright
Public Property  EXIF_DateTime
Public Property  EXIF_DateTime2
Public Property  EXIF_DateTimeOriginal
Public Property  EXIF_DateTimeOriginal2
Public Property  EXIF_DateTimeDigitized
Public Property  EXIF_DateTimeDigitized2
Public Property  EXIF_ExifImageHeight
Public Property  EXIF_ExifImageWidth
Public Property  EXIF_ExifVersion
Public Property  EXIF_ImageDescription
Public Property  EXIF_ImageUniqueID
Public Property  EXIF_InteropIndex
Public Property  EXIF_InteropVersion
Public Property  EXIF_ResolutionUnit
Public Property  EXIF_Software
Public Property  EXIF_UserCommentCode
Public Property  EXIF_UserComment
Public Property  EXIF_XResolution
Public Property  EXIF_XResolution2
Public Property  EXIF_YResolution
Public Property  EXIF_YResolution2

Photographic EXIF Tags
Public Property  EXIF_ApertureValue
Public Property  EXIF_ApertureValue2
Public Property  EXIF_BodySerialNumber
Public Property  EXIF_BrightnessValue
Public Property  EXIF_CameraOwnerName
Public Property  EXIF_ColorSpace
Public Property  EXIF_Contrast
Public Property  EXIF_DigitalZoomRatio
Public Property  EXIF_ExposureBiasValue
Public Property  EXIF_ExposureIndex
Public Property  EXIF_ExposureMode
Public Property  EXIF_ExposureProgram
Public Property  EXIF_ExposureTime
Public Property  EXIF_ExposureTime2
Public Property  EXIF_FileSource
Public Property  EXIF_FlashPixVersion
Public Property  EXIF_Flash
Public Property  EXIF_FNumber
Public Property  EXIF_FNumber2
Public Property  EXIF_FocalLength
Public Property  EXIF_FocalLengthIn35mmFilm
Public Property  EXIF_FocalPlaneResolutionUnit
Public Property  EXIF_FocalPlaneXResolution
Public Property  EXIF_FocalPlaneYResolution
Public Property  EXIF_GainControl
Public Property  EXIF_Gamma
Public Property  EXIF_ISOSpeedRatings
Public Property  EXIF_LensMake
Public Property  EXIF_LensModel
Public Property  EXIF_LensSerialNumber
Public Property  EXIF_LightSource
Public Property  EXIF_Make
Public Property  EXIF_MakerNote
Public Property  EXIF_MaxApertureValue
Public Property  EXIF_MaxApertureValue2
Public Property  EXIF_MeteringMode
Public Property  EXIF_Model
Public Property  EXIF_Orientation
Public Property  EXIF_PrimaryChromaticities
Public Property  EXIF_ReferenceBlackWhite
Public Property  EXIF_RelatedSoundFile
Public Property  EXIF_Saturation
Public Property  EXIF_SceneCaptureType
Public Property  EXIF_SceneType
Public Property  EXIF_SensingMethod
Public Property  EXIF_Sharpness
Public Property  EXIF_ShutterSpeedValue
Public Property  EXIF_ShutterSpeedValue2
Public Property  EXIF_SubjectArea
Public Property  EXIF_SubjectDistanceRange
Public Property  EXIF_SubjectDistance
Public Property  EXIF_SubjectLocationX
Public Property  EXIF_SubjectLocationY
Public Property  EXIF_SubsecTimeDigitized
Public Property  EXIF_SubsecTimeOriginal
Public Property  EXIF_SubsecTime
Public Property  EXIF_WhiteBalance
Public Property  EXIF_WhitePoint
Public Property  EXIF_YCbCrCoefficients
Public Property  EXIF_YCbCrPositioning

GPS EXIF Tags
Public Property  EXIF_GPSVersionID
Public Property  EXIF_GPSLatitude
Public Property  EXIF_GPSLatitude_Str
Public Property  EXIF_GPSLatitudeRef
Public Property  EXIF_GPSLatitudeDegrees
Public Property  EXIF_GPSLatitudeMinutes
Public Property  EXIF_GPSLatitudeSeconds
Public Property  EXIF_GPSLongitude
Public Property  EXIF_GPSLongitude_Str
Public Property  EXIF_GPSLongitudeRef
Public Property  EXIF_GPSLongitudeDegrees
Public Property  EXIF_GPSLongitudeMinutes
Public Property  EXIF_GPSLongitudeSeconds
Public Property  EXIF_GPSAltitudeRef
Public Property  EXIF_GPSAltitude
Public Property  EXIF_GPSTimeStampHour
Public Property  EXIF_GPSTimeStampMinute
Public Property  EXIF_GPSTimeStampSecond
Public Property  EXIF_GPSSatellites
Public Property  EXIF_GPSStatus
Public Property  EXIF_GPSMeasureMode
Public Property  EXIF_GPSDOP
Public Property  EXIF_GPSSpeedRef
Public Property  EXIF_GPSSpeed
Public Property  EXIF_GPSTrackRef
Public Property  EXIF_GPSTrack
Public Property  EXIF_GPSImgDirectionRef
Public Property  EXIF_GPSImgDirection
Public Property  EXIF_GPSMapDatum
Public Property  EXIF_GPSDestLatitudeRef
Public Property  EXIF_GPSDestLatitudeDegrees
Public Property  EXIF_GPSDestLatitudeMinutes
Public Property  EXIF_GPSDestLatitudeSeconds
Public Property  EXIF_GPSDestLongitudeRef
Public Property  EXIF_GPSDestLongitudeDegrees
Public Property  EXIF_GPSDestLongitudeMinutes
Public Property  EXIF_GPSDestLongitudeSeconds
Public Property  EXIF_GPSDestBearingRef
Public Property  EXIF_GPSDestBearing
Public Property  EXIF_GPSDestDistanceRef
Public Property  EXIF_GPSDestDistance
Public Property  EXIF_GPSDateStamp

EXIF Methods
 Inject EXIF into a TIFF image using InjectTIFFEXIF or JPEG image using InjectJpegEXIF (to avoid resaving the image)
 To determine if a file type supports EXIF use SupportsInfo
 Clear the EXIF from a file using ResetInfo
 To use the the embedded thumbnail in EXIF data to speed up thumbnail display in TImageEnMView, you can enable EnableLoadEXIFThumbnails
 You can use the TIEMetaListView to display and edit EXIF fields


Examples

label1.Caption := 'Horz. Resolution: ' + ImageEnView1.IO.Params.EXIF_XResolution2;
label2.Caption := 'Vert. Resolution: ' + ImageEnView1.IO.Params.EXIF_YResolution2;
label3.Caption := 'Exposure Time: ' + ImageEnView1.IO.Params.EXIF_ExposureTime2;
label4.Caption := 'F-Number: ' + ImageEnView1.IO.Params.EXIF_FNumber2;
label5.Caption := 'Shutter Speed: ' + ImageEnView1.IO.Params.EXIF_ShutterSpeedValue2;
label6.Caption := 'Aperture: ' + ImageEnView1.IO.Params.EXIF_ApertureValue2;
label7.Caption := 'Max Aperture: ' + ImageEnView1.IO.Params.EXIF_MaxApertureValue2;

// Update EXIF date for the current file
ImageEnView1.IO.Params.EXIF_DateTime2 := Now;
ImageEnView1.IO.Params.EXIF_DateTimeOriginal2 := Now;
ImageEnView1.IO.Params.EXIF_HasEXIFData  := True;
ImageEnView1.IO.InjectJpegEXIF( ImageEnView1.IO.Params.Filename );

// Remove EXIF data from image.jpg
ImageEnView1.IO.Params.EXIF_HasExifData := False;
ImageEnView1.IO.SaveToFile('D:\image.jpg'); // Or use InjectJpegEXIF to avoid resaving the image

// Update the GPS EXIF data in a file
io := TImageEnIO.create(nil);
try
  io.ParamsFromFile( FilenameStr );

  io.Params.EXIF_GPSLatitude  := GPSLatitudeFloat;
  io.Params.EXIF_GPSLongitude := GPSLongitudeFloat;
  io.Params.EXIF_GPSVersionID := GPS_Version_ID;
  io.Params.EXIF_HasEXIFData  := True;

  io.InjectJpegEXIF( FilenameStr );
finally
  io.Free;
end;

// Write EXIF GSP data to the current file
ImageEnView1.IO.Params.EXIF_GPSLatitude  := StrToFloat( edtEXIF_GPSLatitude.Text );
ImageEnView1.IO.Params.EXIF_GPSLongitude := StrToFloat( edtEXIF_GPSLongitude.Text );
ImageEnView1.IO.Params.EXIF_GPSVersionID := GPS_Version_ID;
ImageEnView1.IO.InjectJpegEXIF('D:\GPSStamped.jpg');

// Write a comment to the file
ImageEnView1.IO.LoadFromFile('C:\input.jpg');
ImageEnView1.IO.Params.EXIF_UserComment := 'Hello World!';
ImageEnView1.IO.Params.EXIF_UserCommentCode := IEExifUserCommentCode_Unicode;
ImageEnView1.IO.Params.EXIF_HasEXIFData := true;
ImageEnView1.IO.SaveToFileTIFF('D:\test.tiff');

// Read back the comment
ImageEnView1.IO.LoadFromFileTIFF('D:\test.tiff');
ShowMessage( ImageEnView1.IO.Params.EXIF_UserComment );


See Also

 EXIF Overview
 ResetEXIF
 GetMetaData