All of my code is here:
Code: Select all
Dim ii As Long
Dim oGdPicture As GdpicturePro.cGdPicture
Set oGdPicture = New GdpicturePro.cGdPicture
oGdPicture.SetLicenceNumber ("0012345678910111213141516") 'Demo code version
ii = oGdPicture.LoadFromFile("c:\test.jpg")
oGdPicture.TagsWriteTypeASCII PropertyTagGpsVer, "2.1"
oGdPicture.TagsWriteTypeASCII PropertyTagGpsLongitude, "130°33'31.4"""
oGdPicture.TagsWriteTypeASCII PropertyTagGpsGpsTime, "12:05:06"
oGdPicture.TagsWriteTypeASCII &H1D, "2007:11:22"
oGdPicture.SaveAsJpeg "c:\test1.jpg"
oGdPicture.CloseImage ii
the test photo file
test.jpg already contain GPS Tags, you can download the test.jpg file here:
http://www.flickr.com/photo_zoom.gne?id ... 539&size=o
I use "Opanda IExif 2.26" to read the GPS Tags, the result is follow:
Code: Select all
[GPS]
GPS Version ID = Version 2.2
GPS Latitude Ref = North latitude
GPS Latitude = 33°24'51.8"
GPS Longitude Ref = East longitude
GPS Longitude = 130°33'31.4"
GPS Time Stamp = 22:14:39 UTC
GPS Status = Measurement in progress
GPS Map Datum = WGS-84
GPS Date Stamp = 2006-11-02 UTC
If I use ExifTag.exe which come from GDPicture sample code folder, the result is:
Code: Select all
GpsVer: 1 4
GpsLatitudeRef: N
GpsLatitude: 33/1, 24/1, 518/10
GpsLongitudeRef: E
GpsLongitude: 130/1, 33/1, 314/10
GpsGpsTime: 22/1, 14/1, 39/1
GpsGpsStatus: A
GpsMapDatum: WGS-84
Unknown TAG: 2006:11:02
Remember all above data is come from
test.jpg,, Now we run my vb code to create
test1.jpg, you can download the
test1.jpg here:
http://www.flickr.com/photo_zoom.gne?id ... 719&size=o
Ok, let's check
test1.jpg with "Opanda IExif 2.26", the result is:
Code: Select all
[GPS]
GPS Version ID = 2.1
GPS Latitude Ref = North latitude
GPS Latitude = 33°24'51.8"
GPS Longitude Ref = East longitude
GPS Longitude = 559509°50'19.6746"
GPS Time Stamp = 00:00:00 UTC
GPS Status = Measurement in progress
GPS Map Datum = WGS-84
The Longitude/time stamp is all mistake, and the "date" field is lose.
then, let us check the test1.jpg with ExifTag.exe, the result is:
Code: Select all
GpsVer: 2.1
GpsLatitudeRef: N
GpsLatitude: 33/1, 24/1, 518/10
GpsLongitudeRef: E
GpsLongitude: 130°33'31.4"
GpsGpsTime: 12:05:06
GpsGpsStatus: A
GpsMapDatum: WGS-84
Looks like the Longitude and time is ok,, but, it's incorrect. and the
GPSdate are lose too.
Opanda IExif is freeware, you can download it here:
http://www.opanda.com/en/iexif/download.htm
My Platform is Windows Server 2003 BIG5 Taiwan edition, VB6 Sp6 english version.
Thanks!