Versioner sammenlignet

Nøgle

  • Linjen blev tilføjet.
  • Denne linje blev fjernet.
  • Formatering blev ændret.

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: https://exposingtheinvisible.org/resources/image-digging

...

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

Tip

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



Kodeblok
titleupdatePages.sh
# EXIF Support

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

      # 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 }')

  fi


....
....


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


  else

   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

Tip

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


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

...