ImageEn, unit imageenio

TImageEnIO.InjectJpegEXIF

TImageEnIO.InjectJpegEXIF


Declaration

function InjectJpegEXIF(const FileName: WideString): Boolean;


Description

Replaces the EXIF information in the specified JPEG file with the current EXIF (in Params) without loading or modifying the original image.

The method returns False if the operation could not be performed.


Examples

// copy the EXIF info (not the image) from file one.jpg inside two.jpg, without loading any image
ImageEnView1.IO.ParamsFromFile('D:\one.jpg');
ImageEnView1.IO.InjectJpegEXIF('D:\two.jpg');

// Remove EXIF data from image.jpg
ImageEnView1.IO.Params.EXIF_HasExifData := False;
ImageEnView1.IO.InjectJpegEXIF('D:\image.jpg');

// 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;