Picture EXIF data
Every time you take a picture with a digital camera, information like coordinates, date and time, etc., is stored together with the image (known as EXIF data). We make it possible to fetch all this information, so you can for example extract latitude and longitude to then connect to a Map where you can see the exact spot of the shoot. This will be very useful for personnel working in the field taking pictures to report hazards, risk assessments, to audit civil works, etc.
To store the whole information from your picture, you must create a Note field for this exclusive use. Then:
-
In Form designer, select the Media component or the Button component connected to the File that will store the picture.
-
Click on the property "Run on change" or "Run on click" (for Media or Button, respectively), and type the following query:
set NoteField = readExif(FileField)
-
After that, you can extract specific values from the Note field. Be aware that the format of the data may vary between mobile devices:
/* The below example is based on EXIF that stores Latitude as an array of the form [degrees, minutes, seconds] */ let @degrees = parsejson(NoteField, 'GPSLatitude[0]') let @min = parsejson(NoteField, 'GPSLatitude[1]') let @sec = parsejson(NoteField, 'GPSLatitude[2]') set Latitude = @degress + (@min / 60) + (@sec / 3600)
To extract a specific value without having to store the EXIF data in a Note field, use these queries instead:
await @exif = readExif(FileField)
set MyLatitudeField = parsejson(@exif, 'GPSLatitude[0]')