Du ser en gammel version af denne side. Se den nuværende version.

Sammenlign med nuværende Vis sidehistorik

Version 1 Næste »

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

So, I added the exiftool to the Ubuntu server running Confluence, and added 2 code parts to the code:

makeThumbs.sh
#Extract EXIF data if the file does not exist
  if [ ! -f $StartDir/$dir/$pic.exif ]
  then
       #Extract EXIF data
       exiftool -c "%.6f" $pic > $pic.exif
       echo "extracting EXIF data from $pic"
  fi

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


updatePages.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" macro - the part that renders the image on the Confluence page

  • Ingen etiketter