To add some new stuff to the Mos-Eisley Gallery, I decided to extract EXIF data and use the GPS part. Inspired by this article:

So, I added the exiftool to the Ubuntu server running Confluence, and added 2 code parts to the code:
#Extract EXIF data if the file does not exist
  if [ ! -f $StartDir/$dir/$pic.exif ]
       #Extract EXIF data
       exiftool -c "%.6f" $pic > $pic.exif
       echo "extracting EXIF data from $pic"

This little piece extracts EXIF to a file placed alongside the image.

I am giving the EXIF files the .exif filename extension, so they are easy to identify and delete.
# EXIF Support

  if [ -f $MediaRoot/$Dir/$file/$image.exif ]

      # An EXIF file exists for the Image

      GPSPos=$(cat "$MediaRoot/$Dir/$file/$image.exif" | grep "GPS Position" | sed 's/GPS\ Position//g' | sed 's/://g')
      Lattitude=$(echo $GPSPos | awk -F "," '{ print $1 }')
      Longitude=$(echo $GPSPos | awk -F "," '{ print $2 }')



    echo "{me-image:path=$Dir/$file2|image=$image|group=$group|thumbsize=$ThumbSize|displaysize=$DisplaySize|lattitude=$Lattitude|longitude=$Longitude}" >> $WikiPageFile


   echo "{me-image:path=$Dir/$file2|image=$image|group=$group|thumbsize=$ThumbSize|displaysize=$DisplaySize|lattitude=$Lattitude|longitude=$Longitude}" >> $WikiFile

This next part extracts the Lattitide and Longitude from the EXIF file, and adds the data to the "me-image" User Macro - the part that renders the image on the Confluence page

For Open Street Maps its actually not nessesary to split Lattitude and Longitude (smile)

finally, I needed to add support to the "me-image" User Macro:

## @param lattitude:title=Lattitude|type=string|required=false|desc=Lattitude Geocoordinat
## @param longitude:title=Longitude|type=string|required=false|desc=Longitude Geocoordinat


#if (${paramlattitude} != "" &&  ${paramlongitude} != "" && ${paramlattitude} && ${paramlongitude} )
<br>View photo location on Open Street Map: <a href="${paramlattitude},${paramlongitude}&namedetails=1&zoom=18&addressdetails=1" target="_location"><img src="" width=20px></a>

Now, if the Image has GPS coordinates, a small icon will be rederen with a link to Open Street Maps:

Links to: