GSAK (Geocaching Swiss Army Knife)
Contents - Index

ImageInfo (function)

ImageInfo(sProperty,[sFileName]) : string
This function allows you to retrieve the properties of an image file. Probably the most interesting are the GPS related "EXIF_" values. 

sProperty - the property name to retrieve

sFileName - Optional, although must be used at least once to set up the initial reading of the properties of the image file and writing to the "ImageInfo" table in the gsak.db3 database. When omitted, the function fetches the properties directly from the ImageInfo table, so you get the values for the last file name used. 

For example, here is a small snippet of code to show the location of an image file from my Garmin Oregon 650 GPS using the camera (To simplify, I first copied the file from my GPSr to "c:\temp" and renamed it "gps.jpg")

$lat = ImageInfo("EXIF_GPSLatitude","c:\temp\gps.jpg")
$lon = ImageInfo("EXIF_GPSLongitude")
Web URL=$lat+$lon

The following macro code will list all the properties for an image. If the image does not have EXIF information then only the IMG_ properties will show. Also note that not all EXIF properties are supported by all GPS/Phones/Cameras, so not every value will show a valid value. 

$lat = ImageInfo("EXIF_GPSLatitude","c:\temp\gps.jpg") # Any value could be used here as we just want to force population of the ImageInfo table
$status = sqlite("open","$_AppData\gsak.db3")
$data = sqlite("sql","select * from ImageInfo order by property","Headings=Yes")
$data = SqlToHtml($data,"Image details","y")


Alpha List         Category List

Copyright 2004-2016 CWE Computer Services  
Privacy Policy Contact