thread184-1173924
Eric while your code works it is not accurate for the GPS Data.
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
Top = 0
Left = 17
Height = 350
Width = 400
DoCreate = .T.
Caption = "Get Image Properties (EXIF)"
Name = "Form1"
ADD OBJECT grid1 AS grid WITH ;
Anchor = 14, ;
Height = 351, ;
Left = 0, ;
Top = 0, ;
Width = 400, ;
Name = "Grid1"
PROCEDURE createpropertycursor
CREATE CURSOR crsProps (PropName C(50), IDValue I)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsVer", 0x0000)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsLatitudeRef", 0x0001)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsLatitude", 0x0002)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsLongitudeRef", 0x0003)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsLongitude", 0x0004)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsAltitudeRef", 0x0005)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsAltitude", 0x0006)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsGpsTime", 0x0007)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsGpsSatellites", 0x0008)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsGpsStatus", 0x0009)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsGpsMeasureMode", 0x000A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsGpsDop", 0x000B)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsSpeedRef", 0x000C)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsSpeed", 0x000D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsTrackRef", 0x000E)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsTrack", 0x000F)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsImgDirRef", 0x0010)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsImgDir", 0x0011)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsMapDatum", 0x0012)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsDestLatRef", 0x0013)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsDestLat", 0x0014)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsDestLongRef", 0x0015)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsDestLong", 0x0016)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsDestBearRef", 0x0017)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsDestBear", 0x0018)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsDestDistRef", 0x0019)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsDestDist", 0x001A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagNewSubfileType", 0x00FE)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagSubfileType", 0x00FF)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagImageWidth", 0x0100)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagImageHeight", 0x0101)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagBitsPerSample", 0x0102)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagCompression", 0x0103)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPhotometricInterp", 0x0106)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThreshHolding", 0x0107)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagCellWidth", 0x0108)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagCellHeight", 0x0109)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagFillOrder", 0x010A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagDocumentName", 0x010D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagImageDescription", 0x010E)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagEquipMake", 0x010F)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagEquipModel", 0x0110)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagStripOffsets", 0x0111)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagOrientation", 0x0112)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagSamplesPerPixel", 0x0115)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagRowsPerStrip", 0x0116)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagStripBytesCount", 0x0117)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagMinSampleValue", 0x0118)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagMaxSampleValue", 0x0119)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagXResolution", 0x011A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagYResolution", 0x011B)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPlanarConfig", 0x011C)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPageName", 0x011D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagXPosition", 0x011E)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagYPosition", 0x011F)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagFreeOffset", 0x0120)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagFreeByteCounts", 0x0121)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGrayResponseUnit", 0x0122)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGrayResponseCurve", 0x0123)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagT4Option", 0x0124)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagT6Option", 0x0125)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagResolutionUnit", 0x0128)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPageNumber", 0x0129)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagTransferFunction", 0x012D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagSoftwareUsed", 0x0131)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagDateTime", 0x0132)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagArtist", 0x013B)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagHostComputer", 0x013C)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPredictor", 0x013D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagWhitePoint", 0x013E)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPrimaryChromaticities", 0x013F)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagColorMap", 0x0140)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagHalftoneHints", 0x0141)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagTileWidth", 0x0142)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagTileLength", 0x0143)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagTileOffset", 0x0144)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagTileByteCounts", 0x0145)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagInkSet", 0x014C)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagInkNames", 0x014D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagNumberOfInks", 0x014E)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagDotRange", 0x0150)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagTargetPrinter", 0x0151)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExtraSamples", 0x0152)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagSampleFormat", 0x0153)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagSMinSampleValue", 0x0154)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagSMaxSampleValue", 0x0155)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagTransferRange", 0x0156)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGProc", 0x0200)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGInterFormat", 0x0201)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGInterLength", 0x0202)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGRestartInterval", 0x0203)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGLosslessPredictors", 0x0205)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGPointTransforms", 0x0206)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGQTables", 0x0207)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGDCTables", 0x0208)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGACTables", 0x0209)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagYCbCrCoefficients", 0x0211)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagYCbCrSubsampling", 0x0212)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagYCbCrPositioning", 0x0213)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagREFBlackWhite", 0x0214)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGamma", 0x0301)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagICCProfileDescriptor", 0x0302)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagSRGBRenderingIntent", 0x0303)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagImageTitle", 0x0320)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagResolutionXUnit", 0x5001)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagResolutionYUnit", 0x5002)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagResolutionXLengthUnit", 0x5003)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagResolutionYLengthUnit", 0x5004)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPrintFlags", 0x5005)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPrintFlagsVersion", 0x5006)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPrintFlagsCrop", 0x5007)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPrintFlagsBleedWidth", 0x5008)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPrintFlagsBleedWidthScale", 0x5009)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagHalftoneLPI", 0x500A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagHalftoneLPIUnit", 0x500B)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagHalftoneDegree", 0x500C)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagHalftoneShape", 0x500D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagHalftoneMisc", 0x500E)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagHalftoneScreen", 0x500F)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGQuality", 0x5010)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGridSize", 0x5011)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailFormat", 0x5012)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailWidth", 0x5013)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailHeight", 0x5014)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailColorDepth", 0x5015)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailPlanes", 0x5016)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailRawBytes", 0x5017)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailSize", 0x5018)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailCompressedSize", 0x5019)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagColorTransferFunction", 0x501A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailData", 0x501B)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailImageWidth", 0x5020)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailImageHeight", 0x5021)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailBitsPerSample", 0x5022)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailCompression", 0x5023)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailPhotometricInterp", 0x5024)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailImageDescription", 0x5025)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailEquipMake", 0x5026)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailEquipModel", 0x5027)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailStripOffsets", 0x5028)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailOrientation", 0x5029)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailSamplesPerPixel", 0x502A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailRowsPerStrip", 0x502B)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailStripBytesCount", 0x502C)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailResolutionX", 0x502D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailResolutionY", 0x502E)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailPlanarConfig", 0x502F)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailResolutionUnit", 0x5030)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailTransferFunction", 0x5031)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailSoftwareUsed", 0x5032)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailDateTime", 0x5033)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailArtist", 0x5034)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailWhitePoint", 0x5035)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailPrimaryChromaticities", 0x5036)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailYCbCrCoefficients", 0x5037)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailYCbCrSubsampling", 0x5038)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailYCbCrPositioning", 0x5039)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailRefBlackWhite", 0x503A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailCopyRight", 0x503B)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagLuminanceTable", 0x5090)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagChrominanceTable", 0x5091)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagFrameDelay", 0x5100)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagLoopCount", 0x5101)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGlobalPalette", 0x5102)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagIndexBackground", 0x5103)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagIndexTransparent", 0x5104)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPixelUnit", 0x5110)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPixelPerUnitX", 0x5111)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPixelPerUnitY", 0x5112)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPaletteHistogram", 0x5113)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagCopyright", 0x8298)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifExposureTime", 0x829A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFNumber", 0x829D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifIFD", 0x8769)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagICCProfile", 0x8773)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifExposureProg", 0x8822)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifSpectralSense", 0x8824)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsIFD", 0x8825)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifISOSpeed", 0x8827)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifOECF", 0x8828)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifVer", 0x9000)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifDTOrig", 0x9003)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifDTDigitized", 0x9004)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifCompConfig", 0x9101)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifCompBPP", 0x9102)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifShutterSpeed", 0x9201)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifAperture", 0x9202)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifBrightness", 0x9203)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifExposureBias", 0x9204)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifMaxAperture", 0x9205)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifSubjectDist", 0x9206)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifMeteringMode", 0x9207)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifLightSource", 0x9208)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFlash", 0x9209)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFocalLength", 0x920A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifMakerNote", 0x927C)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifUserComment", 0x9286)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifDTSubsec", 0x9290)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifDTOrigSS", 0x9291)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifDTDigSS", 0x9292)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFPXVer", 0xA000)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifColorSpace", 0xA001)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifPixXDim", 0xA002)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifPixYDim", 0xA003)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifRelatedWav", 0xA004)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifInterop", 0xA005)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFlashEnergy", 0xA20B)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifSpatialFR", 0xA20C)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFocalXRes", 0xA20E)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFocalYRes", 0xA20F)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFocalResUnit", 0xA210)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifSubjectLoc", 0xA214)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifExposureIndex", 0xA215)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifSensingMethod", 0xA217)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFileSource", 0xA300)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifSceneType", 0xA301)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifCfaPattern", 0xA302)
INDEX ON IDValue TO IDValue
ENDPROC
PROCEDURE retrievepropname
LPARAMETERS tnPropertyID
LOCAL lcReturn
lcReturn = "Unknown"
IF SEEK(tnPropertyID, "crsProps", "IDValue")
lcReturn = crsProps.PropName
ENDIF
RETURN lcReturn
ENDPROC
PROCEDURE getimageproperties
LOCAL lnMax
DIMENSION aryProps(1)
aryProps(1) = NULL
WITH this
lnMax = .GpImage1.GetPropertyIDList(@aryProps)
CREATE CURSOR crsEXIF (Property c(50), Data c(100))
FOR lnCounter = 1 TO lnMax
INSERT INTO crsEXIF (Property, Data) VALUES (.RetrievePropName(aryProps(lnCounter)), TRANSFORM(.GpImage1.GetPropertyItem(aryProps(lnCounter))))
ENDFOR
GO TOP IN crsEXIF
ENDWITH
ENDPROC
PROCEDURE fillpropertygrid
WITH this
.createpropertycursor()
.getimageproperties()
.grid1.RecordSource = "crsEXIF"
.grid1.Refresh()
.grid1.AutoFit()
ENDWITH
ENDPROC
PROCEDURE Init
LOCAL lcImageFile
lcImageFile = GETPICT()
IF EMPTY(lcImageFile)
RETURN .F.
ENDIF
IF !("_GDIPLUS" $ SET("Classlib"))
SET CLASSLIB TO LOCFILE(HOME(1) + "FFC\_gdiplus.vcx", "VCX", "Select _gdiplus.vcx")
ENDIF
THIS.ADDOBJECT("gpImage1", "gpImage", lcImageFile, .F.)
THIS.fillpropertygrid()
ENDPROC
PROCEDURE Destroy
USE IN SELECT("crsProps")
USE IN SELECT("crsEXIF")
ENDPROC
ENDDEFINE
The Latidue and Longtitude are 24 bytes long but yours returns Degrees and Minutes only, if you right click a GPS tagged picture in Windows you also get the Seconds too
Why does this peice of code although very good not display
DEGREES MINUTES AND SECONDS - is it to dowith the code or the GDI VCX library
Eric while your code works it is not accurate for the GPS Data.
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
Top = 0
Left = 17
Height = 350
Width = 400
DoCreate = .T.
Caption = "Get Image Properties (EXIF)"
Name = "Form1"
ADD OBJECT grid1 AS grid WITH ;
Anchor = 14, ;
Height = 351, ;
Left = 0, ;
Top = 0, ;
Width = 400, ;
Name = "Grid1"
PROCEDURE createpropertycursor
CREATE CURSOR crsProps (PropName C(50), IDValue I)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsVer", 0x0000)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsLatitudeRef", 0x0001)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsLatitude", 0x0002)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsLongitudeRef", 0x0003)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsLongitude", 0x0004)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsAltitudeRef", 0x0005)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsAltitude", 0x0006)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsGpsTime", 0x0007)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsGpsSatellites", 0x0008)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsGpsStatus", 0x0009)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsGpsMeasureMode", 0x000A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsGpsDop", 0x000B)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsSpeedRef", 0x000C)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsSpeed", 0x000D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsTrackRef", 0x000E)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsTrack", 0x000F)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsImgDirRef", 0x0010)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsImgDir", 0x0011)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsMapDatum", 0x0012)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsDestLatRef", 0x0013)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsDestLat", 0x0014)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsDestLongRef", 0x0015)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsDestLong", 0x0016)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsDestBearRef", 0x0017)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsDestBear", 0x0018)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsDestDistRef", 0x0019)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsDestDist", 0x001A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagNewSubfileType", 0x00FE)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagSubfileType", 0x00FF)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagImageWidth", 0x0100)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagImageHeight", 0x0101)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagBitsPerSample", 0x0102)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagCompression", 0x0103)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPhotometricInterp", 0x0106)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThreshHolding", 0x0107)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagCellWidth", 0x0108)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagCellHeight", 0x0109)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagFillOrder", 0x010A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagDocumentName", 0x010D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagImageDescription", 0x010E)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagEquipMake", 0x010F)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagEquipModel", 0x0110)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagStripOffsets", 0x0111)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagOrientation", 0x0112)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagSamplesPerPixel", 0x0115)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagRowsPerStrip", 0x0116)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagStripBytesCount", 0x0117)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagMinSampleValue", 0x0118)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagMaxSampleValue", 0x0119)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagXResolution", 0x011A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagYResolution", 0x011B)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPlanarConfig", 0x011C)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPageName", 0x011D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagXPosition", 0x011E)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagYPosition", 0x011F)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagFreeOffset", 0x0120)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagFreeByteCounts", 0x0121)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGrayResponseUnit", 0x0122)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGrayResponseCurve", 0x0123)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagT4Option", 0x0124)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagT6Option", 0x0125)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagResolutionUnit", 0x0128)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPageNumber", 0x0129)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagTransferFunction", 0x012D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagSoftwareUsed", 0x0131)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagDateTime", 0x0132)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagArtist", 0x013B)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagHostComputer", 0x013C)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPredictor", 0x013D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagWhitePoint", 0x013E)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPrimaryChromaticities", 0x013F)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagColorMap", 0x0140)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagHalftoneHints", 0x0141)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagTileWidth", 0x0142)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagTileLength", 0x0143)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagTileOffset", 0x0144)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagTileByteCounts", 0x0145)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagInkSet", 0x014C)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagInkNames", 0x014D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagNumberOfInks", 0x014E)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagDotRange", 0x0150)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagTargetPrinter", 0x0151)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExtraSamples", 0x0152)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagSampleFormat", 0x0153)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagSMinSampleValue", 0x0154)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagSMaxSampleValue", 0x0155)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagTransferRange", 0x0156)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGProc", 0x0200)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGInterFormat", 0x0201)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGInterLength", 0x0202)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGRestartInterval", 0x0203)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGLosslessPredictors", 0x0205)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGPointTransforms", 0x0206)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGQTables", 0x0207)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGDCTables", 0x0208)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGACTables", 0x0209)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagYCbCrCoefficients", 0x0211)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagYCbCrSubsampling", 0x0212)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagYCbCrPositioning", 0x0213)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagREFBlackWhite", 0x0214)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGamma", 0x0301)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagICCProfileDescriptor", 0x0302)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagSRGBRenderingIntent", 0x0303)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagImageTitle", 0x0320)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagResolutionXUnit", 0x5001)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagResolutionYUnit", 0x5002)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagResolutionXLengthUnit", 0x5003)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagResolutionYLengthUnit", 0x5004)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPrintFlags", 0x5005)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPrintFlagsVersion", 0x5006)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPrintFlagsCrop", 0x5007)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPrintFlagsBleedWidth", 0x5008)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPrintFlagsBleedWidthScale", 0x5009)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagHalftoneLPI", 0x500A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagHalftoneLPIUnit", 0x500B)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagHalftoneDegree", 0x500C)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagHalftoneShape", 0x500D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagHalftoneMisc", 0x500E)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagHalftoneScreen", 0x500F)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagJPEGQuality", 0x5010)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGridSize", 0x5011)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailFormat", 0x5012)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailWidth", 0x5013)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailHeight", 0x5014)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailColorDepth", 0x5015)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailPlanes", 0x5016)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailRawBytes", 0x5017)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailSize", 0x5018)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailCompressedSize", 0x5019)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagColorTransferFunction", 0x501A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailData", 0x501B)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailImageWidth", 0x5020)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailImageHeight", 0x5021)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailBitsPerSample", 0x5022)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailCompression", 0x5023)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailPhotometricInterp", 0x5024)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailImageDescription", 0x5025)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailEquipMake", 0x5026)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailEquipModel", 0x5027)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailStripOffsets", 0x5028)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailOrientation", 0x5029)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailSamplesPerPixel", 0x502A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailRowsPerStrip", 0x502B)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailStripBytesCount", 0x502C)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailResolutionX", 0x502D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailResolutionY", 0x502E)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailPlanarConfig", 0x502F)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailResolutionUnit", 0x5030)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailTransferFunction", 0x5031)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailSoftwareUsed", 0x5032)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailDateTime", 0x5033)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailArtist", 0x5034)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailWhitePoint", 0x5035)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailPrimaryChromaticities", 0x5036)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailYCbCrCoefficients", 0x5037)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailYCbCrSubsampling", 0x5038)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailYCbCrPositioning", 0x5039)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailRefBlackWhite", 0x503A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagThumbnailCopyRight", 0x503B)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagLuminanceTable", 0x5090)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagChrominanceTable", 0x5091)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagFrameDelay", 0x5100)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagLoopCount", 0x5101)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGlobalPalette", 0x5102)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagIndexBackground", 0x5103)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagIndexTransparent", 0x5104)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPixelUnit", 0x5110)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPixelPerUnitX", 0x5111)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPixelPerUnitY", 0x5112)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagPaletteHistogram", 0x5113)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagCopyright", 0x8298)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifExposureTime", 0x829A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFNumber", 0x829D)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifIFD", 0x8769)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagICCProfile", 0x8773)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifExposureProg", 0x8822)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifSpectralSense", 0x8824)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagGpsIFD", 0x8825)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifISOSpeed", 0x8827)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifOECF", 0x8828)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifVer", 0x9000)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifDTOrig", 0x9003)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifDTDigitized", 0x9004)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifCompConfig", 0x9101)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifCompBPP", 0x9102)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifShutterSpeed", 0x9201)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifAperture", 0x9202)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifBrightness", 0x9203)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifExposureBias", 0x9204)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifMaxAperture", 0x9205)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifSubjectDist", 0x9206)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifMeteringMode", 0x9207)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifLightSource", 0x9208)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFlash", 0x9209)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFocalLength", 0x920A)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifMakerNote", 0x927C)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifUserComment", 0x9286)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifDTSubsec", 0x9290)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifDTOrigSS", 0x9291)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifDTDigSS", 0x9292)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFPXVer", 0xA000)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifColorSpace", 0xA001)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifPixXDim", 0xA002)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifPixYDim", 0xA003)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifRelatedWav", 0xA004)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifInterop", 0xA005)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFlashEnergy", 0xA20B)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifSpatialFR", 0xA20C)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFocalXRes", 0xA20E)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFocalYRes", 0xA20F)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFocalResUnit", 0xA210)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifSubjectLoc", 0xA214)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifExposureIndex", 0xA215)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifSensingMethod", 0xA217)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifFileSource", 0xA300)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifSceneType", 0xA301)
INSERT INTO crsProps (PropName, IDValue) values("PropertyTagExifCfaPattern", 0xA302)
INDEX ON IDValue TO IDValue
ENDPROC
PROCEDURE retrievepropname
LPARAMETERS tnPropertyID
LOCAL lcReturn
lcReturn = "Unknown"
IF SEEK(tnPropertyID, "crsProps", "IDValue")
lcReturn = crsProps.PropName
ENDIF
RETURN lcReturn
ENDPROC
PROCEDURE getimageproperties
LOCAL lnMax
DIMENSION aryProps(1)
aryProps(1) = NULL
WITH this
lnMax = .GpImage1.GetPropertyIDList(@aryProps)
CREATE CURSOR crsEXIF (Property c(50), Data c(100))
FOR lnCounter = 1 TO lnMax
INSERT INTO crsEXIF (Property, Data) VALUES (.RetrievePropName(aryProps(lnCounter)), TRANSFORM(.GpImage1.GetPropertyItem(aryProps(lnCounter))))
ENDFOR
GO TOP IN crsEXIF
ENDWITH
ENDPROC
PROCEDURE fillpropertygrid
WITH this
.createpropertycursor()
.getimageproperties()
.grid1.RecordSource = "crsEXIF"
.grid1.Refresh()
.grid1.AutoFit()
ENDWITH
ENDPROC
PROCEDURE Init
LOCAL lcImageFile
lcImageFile = GETPICT()
IF EMPTY(lcImageFile)
RETURN .F.
ENDIF
IF !("_GDIPLUS" $ SET("Classlib"))
SET CLASSLIB TO LOCFILE(HOME(1) + "FFC\_gdiplus.vcx", "VCX", "Select _gdiplus.vcx")
ENDIF
THIS.ADDOBJECT("gpImage1", "gpImage", lcImageFile, .F.)
THIS.fillpropertygrid()
ENDPROC
PROCEDURE Destroy
USE IN SELECT("crsProps")
USE IN SELECT("crsEXIF")
ENDPROC
ENDDEFINE
The Latidue and Longtitude are 24 bytes long but yours returns Degrees and Minutes only, if you right click a GPS tagged picture in Windows you also get the Seconds too
Why does this peice of code although very good not display
DEGREES MINUTES AND SECONDS - is it to dowith the code or the GDI VCX library