Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TstExifLE.ReadGPSTest;
- var
- imgInfo: TImgInfo;
- lTag: TTag;
- begin
- imgInfo := TImgInfo.Create;
- try
- imgInfo.LoadFromFile(WorkFile_JpegWithExif);
- lTag := imgInfo.ExifData.TagByName['GPSVersionID'];
- CheckTrue(lTag <> nil, 'Tag "GPSVersionID" not found');
- CheckTrue(lTag is TVersionTag, 'Tag "GPSVersionID" is not TVersionTag');
- TVersionTag(lTag).Separator := '.';
- CheckEquals('2.3.0.0', lTag.AsString, 'Value mismatch of tag "GPSVersionID"');
- lTag := imgInfo.ExifData.TagByName['GPSLatitude'];
- CheckTrue(lTag <> nil, 'Tag "GPSLatitude" not found');
- CheckTrue(lTag is TGPSPositionTag, 'Tag "GPSLatitude" is not a TGpsPositionTag');
- TGpsPositionTag(lTag).FormatStr := '%0:.0f deg %1:.0f'' %2:.2f"';
- CheckEquals('51 deg 33'' 48.28"', lTag.AsString, 'Value mismatch of tag "GPSLatitude"');
- lTag := imgInfo.ExifData.TagByName['GPSLatitudeRef'];
- CheckTrue(lTag <> nil, 'Tag "GPSLatitudeRef" not found');
- CheckEquals('South', lTag.AsString, 'Value mismatch of tag "GPSLatitudeRef"');
- lTag := imgInfo.ExifData.TagByName['GPSLongitude'];
- CheckTrue(lTag <> nil, 'Tag "GPSLongitude" not found');
- CheckTrue(lTag is TGPSPositionTag, 'Tag "GPSLongitude" is not a TGpsPositionTag');
- TGpsPositionTag(lTag).FormatStr := '%0:.0f deg %1:.0f'' %2:.2f"';
- CheckEquals('59 deg 49'' 53.55"', lTag.AsString, 'Value mismatch of tag "GPSLongitude"');
- lTag := imgInfo.ExifData.TagByName['GPSLongitudeRef'];
- CheckTrue(lTag <> nil, 'Tag "GPSLongitudeRef" not found');
- CheckEquals('West', lTag.AsString, 'Value mismatch of tag "GPSLongitudeRef"');
- finally
- imgInfo.Free;
- end;
- end;
Add Comment
Please, Sign In to add comment