{"id":252,"date":"2014-12-24T22:56:32","date_gmt":"2014-12-25T06:56:32","guid":{"rendered":"http:\/\/www.skifactz.com\/wifi\/?p=252"},"modified":"2015-08-30T22:34:20","modified_gmt":"2015-08-31T06:34:20","slug":"xmp-and-exif-photo-metadata-editing-automation","status":"publish","type":"post","link":"https:\/\/www.skifactz.com\/wifi\/?p=252","title":{"rendered":"Photo Metadata Editing"},"content":{"rendered":"<p><span style=\"line-height: 1.5;\">Most image file types can contain extensive metadata. This information can describe parameters like geolocation of the photograph, description, keywords, etc.<\/span><\/p>\n<p><span style=\"line-height: 1.5;\">The Exif metadata embedded by a digital camera at the time of the capture can be altered and expanded using any number of free or non-free Exif and XMP editors.<\/span><\/p>\n<p><span style=\"line-height: 1.5;\">Exiftool is a free OS independent command line based editor specifically suited for high volume and automated batch metadata editing. Exiftool is highly scriptable using Bash, Batch, Python or whatever the tool of your choice may be.<\/span><\/p>\n<p><span style=\"line-height: 1.5;\"><b>I<\/b>\u00a0wrote a Linux Bash script for a project where thousands of scanned photographs needed to be augmented with new metadata. Some information was image specific and required user entry like geolocation, description, searchable keywords and the year picture was taken. Other information was hard coded into the script because it was specific to the set like the name of the locale and the country of origin ISO code.<\/span><\/p>\n<p><span style=\"line-height: 1.5;\">The script is essentially a one-liner command:<\/span><\/p>\n<pre class=\"easycode; title: exifmod bash script;lang:;\"> #!\/bin\/bash\r\n\r\necho\u00a0\"Modifying\u00a0image\u00a0\"$1\r\n\r\necho\u00a0\"Enter\u00a0latitude\"\r\nread\u00a0latitude\r\necho\u00a0\"Enter\u00a0longitude\"\r\nread\u00a0longitude\r\necho\u00a0\"Enter\u00a0elevation\"\r\nread\u00a0elevation\r\necho\u00a0\"Enter\u00a0description\"\r\nread\u00a0description\r\necho\u00a0\"Enter\u00a0comma\u00a0separated\u00a0keywords\"\r\nread\u00a0keywords\r\necho\u00a0\"Enter\u00a0year\"\r\nread\u00a0year\r\n\r\nexiftool\u00a0\\\r\n-Description=\"$description\"\u00a0\\\r\n-Subject=\"$keywords\"\u00a0\\\r\n-PersonInImage=\"$description\"\u00a0\\\r\n-ImageDescription=\"$description\"\u00a0\\\r\n-Caption-Abstract=\"$description\"\u00a0\\\r\n-DateCreated=\"$year:01:01\"\u00a0\\\r\n-GPSLongitudeRef=E\u00a0\\\r\n-GPSLongitude=$longitude\u00a0\\\r\n-GPSLatitudeRef=N\u00a0\\\r\n-GPSLatitude=$latitude\u00a0\\\r\n-GPSAltitude=$elevation\u00a0\\\r\n-GPSAltituderef=\"Above\u00a0Sea\u00a0Level\"\u00a0\\\r\n-City=\"Sarajevo\"\u00a0\\\r\n-Country=\"Bosnia\u00a0and\u00a0Herzegovina\"\u00a0\\\r\n-CountryCode=\"3166-2:BA\"\u00a0\\\r\n$1<\/pre>\n<p><span style=\"line-height: 1.5;\">You can use the script from the command line, or you can drag-and-drop pictures onto it (this procedure varies in different Linux distros, we\u2019ll go over the use in Ubuntu).<\/span><\/p>\n<p><span style=\"line-height: 1.5;\">Setup:<\/span><\/p>\n<ol>\n<li>Install Exiftool from the command line: sudo apt-get install libimage-exiftool-perl<\/li>\n<li>Copy and paste the script into a text editor, change the parameters to suit your needs and save as exifmod.<\/li>\n<li>Right click the script and enable executable privileges in the file properties or execute chmod +x exifmod from the command line.<\/li>\n<li>Create an application launcher and point it to the location of the script. In case of exifmod saved on your desktop this would be \/home\/yourusername\/Desktop\/exifmod.<\/li>\n<li>Enable executable privileges for the launcher file as well.<\/li>\n<\/ol>\n<p><span style=\"line-height: 1.5;\">Usage:<\/span><\/p>\n<p><span style=\"line-height: 1.5;\">Drag and drop an image onto the launcher. Follow the prompts in the pop-up console window. Skip properties by leaving the answers blank and pressing enter. You can obtain the longitude and latitude of the photo location from Google Maps.<\/span><\/p>\n<p><span style=\"line-height: 1.5;\">To verify the embedded metadata from the command line use: exiftool -All sampleimage.jpg.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most image file types can contain extensive metadata. This information can describe parameters like geolocation of the photograph, description, keywords, etc. The Exif metadata embedded by a digital camera at the time of the capture can be altered and expanded using any number of free or non-free Exif and XMP editors. Exiftool is a free &hellip; <a href=\"https:\/\/www.skifactz.com\/wifi\/?p=252\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Photo Metadata Editing<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-252","post","type-post","status-publish","format-standard","hentry","category-software"],"_links":{"self":[{"href":"https:\/\/www.skifactz.com\/wifi\/index.php?rest_route=\/wp\/v2\/posts\/252","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skifactz.com\/wifi\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skifactz.com\/wifi\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skifactz.com\/wifi\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skifactz.com\/wifi\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=252"}],"version-history":[{"count":6,"href":"https:\/\/www.skifactz.com\/wifi\/index.php?rest_route=\/wp\/v2\/posts\/252\/revisions"}],"predecessor-version":[{"id":276,"href":"https:\/\/www.skifactz.com\/wifi\/index.php?rest_route=\/wp\/v2\/posts\/252\/revisions\/276"}],"wp:attachment":[{"href":"https:\/\/www.skifactz.com\/wifi\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skifactz.com\/wifi\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=252"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skifactz.com\/wifi\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}