#------------------------------------------------------------------------------
# File:         kml.fmt
#
# Description:  Example ExifTool print format file for generating a
#               Google Earth KML file from a collection of geotagged images
#
# Usage:        exiftool -p kml.fmt -r DIR [...] > out.kml
#
# Requires:     ExifTool version 10.41 or later
#
# Revisions:    2010/02/05 - P. Harvey created
#               2013/02/05 - PH Fixed camera icon to work with new Google Earth
#               2017/02/02 - PH Organize into folders based on file directory
#               2018/01/04 - PH Added IF to be sure position exists
#               2020/01/11 - F. Kotov Limited image preview size to 500px
#
# Notes:     1) Input files must contain GPSLatitude and GPSLongitude.
#            2) Add the -ee3 option to extract the full track from video files.
#            3) For Google Earth to be able to find the images, the input
#               images must be specified using relative paths, and "out.kml"
#               must stay in the same directory as where the command was run.
#            4) Google Earth is picky about the case of the image file extension,
#               and may not be able to display the image if an upper-case
#               extension is used.
#            5) The -fileOrder option may be used to control the order of the
#               generated placemarks when processing multiple files.
#            6) The "0" in the coordinates line may be changed to "$gpsaltitude#"
#               and the altitudeMode may be changed to "absolute" to store
#               altitude information if it exists in the track log.
#------------------------------------------------------------------------------
#[HEAD]<?xml version="1.0" encoding="UTF-8"?>
#[HEAD]<kml xmlns="http://earth.google.com/kml/2.0">
#[HEAD]  <Document>
#[HEAD]    <name>My Photos</name>
#[HEAD]    <open>1</open>
#[HEAD]    <Style id="Photo">
#[HEAD]      <IconStyle>
#[HEAD]        <Icon>
#[HEAD]          <href>http://maps.google.com/mapfiles/kml/pal4/icon38.png</href>
#[HEAD]          <scale>1.0</scale>
#[HEAD]        </Icon>
#[HEAD]      </IconStyle>
#[HEAD]    </Style>
#[SECT]    <Folder>
#[SECT]      <name>$main:directory</name>
#[SECT]      <open>0</open>
#[IF]  $gpslatitude $gpslongitude
#[BODY]      <Placemark>
#[BODY]        <description><![CDATA[<img src='$main:directory/$main:filename'
#[BODY]          style='max-width:500px;max-height:500px;'> ]]>
#[BODY]        </description>
#[BODY]        <Snippet/>
#[BODY]        <name>$filename</name>
#[BODY]        <styleUrl>#Photo</styleUrl>
#[BODY]        <Point>
#[BODY]          <altitudeMode>clampedToGround</altitudeMode>
#[BODY]          <coordinates>$gpslongitude#,$gpslatitude#,0</coordinates>
#[BODY]        </Point>
#[BODY]      </Placemark>
#[ENDS]    </Folder>
#[TAIL]  </Document>
#[TAIL]</kml>
