<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Batch EXIF Tagging?</title>
	<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging/</link>
	<description>Comments on Ask MetaFilter post Batch EXIF Tagging?</description>
	<pubDate>Thu, 18 Aug 2005 14:55:33 -0800</pubDate>
	<lastBuildDate>Thu, 18 Aug 2005 14:55:33 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Batch EXIF Tagging?</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging</link>	
		<description>Is there an EXIF wiz in the house? &lt;br /&gt;&lt;br /&gt; I have a large number of photos that have their &quot;date taken&quot; in the filename (YYMMDD-##.jpg, to be exact), but they have no EXIF info. Before I upload them to flickr, I&apos;d like to change that. Since it&apos;s a lot of pictures, I&apos;m looking for a way to automate the process (plus it&apos;s a matter of principle, since the information is already digital I shouldn&apos;t have to do it by hand.) &lt;br&gt;
&lt;br&gt;
I know about EXIFer, but it doesn&apos;t seem to have this kind of batch function. Is there any other program that will let me batch-process these files and add EXIF information taken from the filename? I know there are taggers that do this kind of thing for mp3s, so why not for EXIF? Thankyoumuch.</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2005:site.22798</guid>
		<pubDate>Thu, 18 Aug 2005 14:34:35 -0800</pubDate>
		<dc:creator>muckster</dc:creator>
		
			<category>exif</category>
		
			<category>flickr</category>
		
			<category>photos</category>
		
			<category>software</category>
		
	</item> <item>
		<title>By: Loser</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#364431</link>	
		<description>I wrote this little Perl script for doing exactly what you&apos;re doing, but I had a data file that contained a tab delimited list with the filename, title, and caption. This script ate up the data, wrote the IPTC values to the jpgs and saved them to out/&lt;br&gt;
&lt;br&gt;
use Image::IPTCInfo;&lt;br&gt;
use strict;&lt;br&gt;
&lt;br&gt;
foreach my $line (&lt;&gt;) {&lt;br&gt;
	my ($jpg, $title, $caption) = split(/\t/, $line);&lt;br&gt;
	my $info = new Image::IPTCInfo($jpg);&lt;br&gt;
	if (defined($info)) {&lt;br&gt;
		$info-&amp;gt;AddKeyword(&apos;some keyword&apos;);&lt;br&gt;
		$info-&amp;gt;SetAttribute(&apos;province/state&apos;, &quot;&quot;);&lt;br&gt;
		$info-&amp;gt;SetAttribute(&apos;city&apos;, &quot;San Francisco&quot;);&lt;br&gt;
		$info-&amp;gt;SetAttribute(&apos;country/primary location name&apos;, &quot;&quot;);&lt;br&gt;
		$info-&amp;gt;SetAttribute(&apos;category&apos;, &quot;some category&quot;);&lt;br&gt;
		$info-&amp;gt;SetAttribute(&apos;object name&apos;, $title);&lt;br&gt;
		$info-&amp;gt;SetAttribute(&apos;headline&apos;, $title);&lt;br&gt;
		$info-&amp;gt;SetAttribute(&apos;by-line title&apos;, $title);&lt;br&gt;
		$info-&amp;gt;SetAttribute(&apos;caption/abstract&apos;, $caption);&lt;br&gt;
		$info-&amp;gt;SetAttribute(&apos;copyright notice&apos;, &quot;&quot;);&lt;br&gt;
		$info-&amp;gt;SaveAs(&quot;out/$jpg&quot;);&lt;br&gt;
&lt;br&gt;
		print &quot;Saving $jpg...\n&quot;;&lt;br&gt;
	}&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
On preview, I forget not everyone&apos;s a programmer; I was assuming that parsing the filename for the date could be an exercise left for the reader. Let me know if that isn&apos;t the case.&lt;/&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-364431</guid>
		<pubDate>Thu, 18 Aug 2005 14:55:33 -0800</pubDate>
		<dc:creator>Loser</dc:creator>
	</item><item>
		<title>By: muckster</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#364446</link>	
		<description>Wow. No, sorry, I&apos;m not a programmer (unless you count BASIC...) so I wouldn&apos;t even know where to begin.  I&apos;m on Windows XP but could upload everything to a UNIX server where I can run perl scripts, in case that makes any difference.&lt;br&gt;
&lt;br&gt;
If you had the patience to explain to me how to use this, that&apos;d be fantastic.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-364446</guid>
		<pubDate>Thu, 18 Aug 2005 15:07:17 -0800</pubDate>
		<dc:creator>muckster</dc:creator>
	</item><item>
		<title>By: phearlez</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#364450</link>	
		<description>Um, none of the 26298292 results from &lt;a href=&quot;http://www.google.com/search?q=batch%20exif&quot;&gt;googling &apos;batch exif&apos;&lt;/a&gt; will do this? Like &lt;a href=&quot;http://www.freedownloadscenter.com/Best/batch-exif.html&quot;&gt;this&lt;/a&gt; or &lt;a href=&quot;http://www.snapfiles.com/get/powerexif.html&quot;&gt;this&lt;/a&gt; or &lt;a href=&quot;http://www.friedemann-schmidt.com/software/exifer/&quot;&gt;this&lt;/a&gt;?&lt;br&gt;
&lt;br&gt;
The &lt;a href=&quot;http://www.friedemann-schmidt.com/software/exifer/&quot;&gt;last one is postcardware&lt;/a&gt; and it&apos;s possible if you write the dude he&apos;d add this feature.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-364450</guid>
		<pubDate>Thu, 18 Aug 2005 15:09:29 -0800</pubDate>
		<dc:creator>phearlez</dc:creator>
	</item><item>
		<title>By: muckster</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#364470</link>	
		<description>phearlez, I know there are shareware programs that may or may not do what I need. I know that Exifer (your third link) won&apos;t. I was hoping somebody could tell me &lt;em&gt;before &lt;/em&gt;I have to install a dozen different programs.&lt;br&gt;
&lt;br&gt;
That&apos;s why I was asking.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-364470</guid>
		<pubDate>Thu, 18 Aug 2005 15:23:26 -0800</pubDate>
		<dc:creator>muckster</dc:creator>
	</item><item>
		<title>By: cactus</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#364514</link>	
		<description>I&apos;ve used &lt;a href=&quot;http://www.sentex.net/~mwandel/jhead/&quot;&gt;jhead&lt;/a&gt; to change the date on a large number of files.  It&apos;s a command line utility available on a number of platforms.&lt;br&gt;
&lt;br&gt;
You&apos;d use it something like this:&lt;br&gt;
&lt;br&gt;
C:\My Pictures\Fascinating Vacation Photos&amp;gt;jhead.exe -ts2005:08:18-23:25:29 *&lt;br&gt;
&lt;br&gt;
But there are plenty of other things you can do with it.  Read the &lt;a href=&quot;http://www.sentex.net/~mwandel/jhead/usage.html&quot;&gt;usage&lt;/a&gt; page or run jhead -h</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-364514</guid>
		<pubDate>Thu, 18 Aug 2005 16:25:54 -0800</pubDate>
		<dc:creator>cactus</dc:creator>
	</item><item>
		<title>By: muckster</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#364522</link>	
		<description>That looks promising, cactus. The thing I haven&apos;t figured out yet is how to insert the info from the file name instead of specifying a date after -ts.  Looks like &amp;amp;i inserts the filename, but that&apos;s in the format YYMMDD, so -ts &amp;amp;i probably won&apos;t work. There&apos;s an &amp;amp;o but I don&apos;t know what it stands for.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-364522</guid>
		<pubDate>Thu, 18 Aug 2005 16:35:51 -0800</pubDate>
		<dc:creator>muckster</dc:creator>
	</item><item>
		<title>By: Jack Karaoke</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#364542</link>	
		<description>I&apos;m sure imatch (&lt;a href=&quot;http://www.photools.com/products.php&quot;&gt;photool.com&lt;/a&gt;) can do this.  The trial version lasts for 30 days.  It&apos;s really meant for cataloging, so you&apos;d be using a tiny fraction of it&apos;s power, but I&apos;m sure it allows for generating EXIF data from filenames.  It&apos;s $60 after 30 days.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-364542</guid>
		<pubDate>Thu, 18 Aug 2005 17:15:03 -0800</pubDate>
		<dc:creator>Jack Karaoke</dc:creator>
	</item><item>
		<title>By: Jack Karaoke</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#364543</link>	
		<description>Er...  photools.com  (previous link is correct, just not my text)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-364543</guid>
		<pubDate>Thu, 18 Aug 2005 17:16:01 -0800</pubDate>
		<dc:creator>Jack Karaoke</dc:creator>
	</item><item>
		<title>By: muckster</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#364555</link>	
		<description>I&apos;ll try that, Jack. Thank you.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-364555</guid>
		<pubDate>Thu, 18 Aug 2005 17:28:29 -0800</pubDate>
		<dc:creator>muckster</dc:creator>
	</item><item>
		<title>By: daveirl</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#364788</link>	
		<description>&lt;a href=&quot;http://www.hugsan.com/EXIFutils/&quot;&gt;EXIFutils&lt;/a&gt; will do everything you want and more. There is decent enough documentation on how to use it.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-364788</guid>
		<pubDate>Fri, 19 Aug 2005 00:47:31 -0800</pubDate>
		<dc:creator>daveirl</dc:creator>
	</item><item>
		<title>By: muckster</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#365046</link>	
		<description>Thanks for the answers, but so far, I can&apos;t figure out how to do it with either iMatch or EXIFutils.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-365046</guid>
		<pubDate>Fri, 19 Aug 2005 09:28:21 -0800</pubDate>
		<dc:creator>muckster</dc:creator>
	</item><item>
		<title>By: phearlez</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#365169</link>	
		<description>If Loser would like to flesh out his perl script to parse the filenames for the input I will be glad to run it through my Activestate perl compiler to get you a windows executable...</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-365169</guid>
		<pubDate>Fri, 19 Aug 2005 11:02:43 -0800</pubDate>
		<dc:creator>phearlez</dc:creator>
	</item><item>
		<title>By: phearlez</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#365245</link>	
		<description>My curiosity got the better of me. Here&apos;s a WAY quick implementation, intolerant of even the slightest variation on YYMMDD-#.jpg, tho # can be any number of digits, 1 to 2829438929292. &lt;br&gt;
&lt;br&gt;
Writes the newly tagged into a subdir named &apos;tagged&apos;. Only does this operation on files in its own directory.&lt;br&gt;
&lt;br&gt;
If you run it more than once you need to delete that  tagged dir first - the ExifTool module won&apos;t overwrite a file.&lt;br&gt;
&lt;br&gt;
The below script is compiled into a windows executable you can download &lt;a href=&quot;http://www.tequilaresearch.com/YYMMDD-Num-to-exif-date.exe&quot;&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
use Image::ExifTool &apos;ImageInfo&apos;;&lt;br&gt;
use strict;&lt;br&gt;
$|=1;&lt;br&gt;
&lt;br&gt;
opendir(DIR, &quot;.&quot;) or die &quot;can&apos;t opendir current directory: $!&quot;;&lt;br&gt;
my $info = new Image::ExifTool;&lt;br&gt;
opendir(destDIR, &quot;./tagged&quot;) or mkdir(&quot;./tagged&quot;);&lt;br&gt;
while (defined(my $file = readdir(DIR))) {&lt;br&gt;
    if ($file !~ /(\d\d)(\d\d)(\d\d)-\d+.jpg/) {&lt;br&gt;
      print &quot;Skipping $file: doesn&apos;t meet YYMMDD-#.jpg requirement\n&quot;;&lt;br&gt;
    } else {&lt;br&gt;
      print &quot;Tagging $file with date 20$1:$2:$3 00:00:00 in directory tagged\n&quot;;&lt;br&gt;
      $info-&amp;gt;SetNewValue(&quot;DateTimeOriginal&quot;, &quot;20$1:$2:$3 00:00:00&quot;);&lt;br&gt;
      $info-&amp;gt;WriteInfo($file, &quot;tagged/$file&quot;);&lt;br&gt;
      print &quot;wrote retagged-$file\n&quot;;&lt;br&gt;
  }&lt;br&gt;
  }&lt;br&gt;
closedir(DIR);</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-365245</guid>
		<pubDate>Fri, 19 Aug 2005 12:54:10 -0800</pubDate>
		<dc:creator>phearlez</dc:creator>
	</item><item>
		<title>By: muckster</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#365286</link>	
		<description>Whoa, that&apos;s fantastic. Let me try that.&lt;br&gt;
&lt;br&gt;
Oh--looks like I&apos;ll have to tweak this for files from 99? That&apos;s how far it goes back. Didn&apos;t expect to run into a Y2K problem at this late date. Let me try it on a folder that doesn&apos;t have 1999 pix in it first...</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-365286</guid>
		<pubDate>Fri, 19 Aug 2005 13:38:46 -0800</pubDate>
		<dc:creator>muckster</dc:creator>
	</item><item>
		<title>By: muckster</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#365295</link>	
		<description>phearlez, I get this:&lt;br&gt;
&lt;br&gt;
Skipping 020306-01.JPG: doesn&apos;t meet YYMMDD-#.jpg requirement&lt;br&gt;
&lt;br&gt;
etc.&lt;br&gt;
&lt;br&gt;
Is it the capital .JPG that&apos;s the problem? It&apos;s only capitalized in DOS, looks lowercase in Windows Explorer.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-365295</guid>
		<pubDate>Fri, 19 Aug 2005 13:49:15 -0800</pubDate>
		<dc:creator>muckster</dc:creator>
	</item><item>
		<title>By: muckster</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#365299</link>	
		<description>OK, I tried renaming on to .jpg under DOS, and now I get:&lt;br&gt;
&lt;br&gt;
Tagging 020406-1.jpg with date 2002:04:06 00:00:00 in directory tagged&lt;br&gt;
Error while attempting to call Image::ExifTool::SetNewValue&lt;br&gt;
Can&apos;t locate Image/ExifTool/Writer.pl in @INC (@INC contains:) at (eval 14) line&lt;br&gt;
 1.&lt;br&gt;
&lt;br&gt;
Is ExifTool something I need to have installed? Thank you so much for this; looks like it&apos;s almost working.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-365299</guid>
		<pubDate>Fri, 19 Aug 2005 13:52:22 -0800</pubDate>
		<dc:creator>muckster</dc:creator>
	</item><item>
		<title>By: phearlez</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#365372</link>	
		<description>Hmmm looks like I don&apos;t know how to use that executable builder as well as I thought. Amazing given the 2 times I&apos;ve done it before :) &lt;br&gt;
&lt;br&gt;
Okay! Now years under 30 are 20XX, years 30+ are 19XX and the search for filename works on both .jpg and .JPG (and even .JpG etc you crazy kids!). The executable is updated, you can find it above.&lt;br&gt;
&lt;br&gt;
For those who are interested the new code is:&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;br&gt;
use Image::ExifTool &apos;ImageInfo&apos;;&lt;br&gt;
use strict;&lt;br&gt;
$|=1;&lt;br&gt;
&lt;br&gt;
opendir(DIR, &quot;.&quot;) or die &quot;can&apos;t opendir current directory: $!&quot;;&lt;br&gt;
my $info = new Image::ExifTool;&lt;br&gt;
opendir(destDIR, &quot;./tagged&quot;) or mkdir(&quot;./tagged&quot;);&lt;br&gt;
while (defined(my $file = readdir(DIR))) {&lt;br&gt;
    if ($file !~ /(\d\d)(\d\d)(\d\d)-\d+.jpg/i) {&lt;br&gt;
      print &quot;Skipping $file: doesn&apos;t meet YYMMDD-#.jpg requirement\n&quot;;&lt;br&gt;
    } else {&lt;br&gt;
      if ( $1 &lt; 30 ) {br&gt;
        print &quot;Tagging $file with date 20$1:$2:$3 00:00:00 in directory tagged\n&quot;;&lt;br&gt;
      $info-&amp;gt;SetNewValue(&quot;DateTimeOriginal&quot;, &quot;20$1:$2:$3 00:00:00&quot;);&lt;br&gt;
      } else {&lt;br&gt;
        print &quot;Tagging $file with date 19$1:$2:$3 00:00:00 in directory tagged\n&quot;;&lt;br&gt;
      $info-&amp;gt;SetNewValue(&quot;DateTimeOriginal&quot;, &quot;19$1:$2:$3 00:00:00&quot;);&lt;br&gt;
      }&lt;br&gt;
      $info-&amp;gt;WriteInfo($file, &quot;tagged/$file&quot;);&lt;br&gt;
      print &quot;wrote retagged-$file\n&quot;;&lt;br&gt;
  }&lt;br&gt;
  }&lt;br&gt;
closedir(DIR);&lt;br&gt;
&lt;/&gt;&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
And yeah, it&apos;s stinky. Sue me - I was trying to spend the least amount of time possible on it.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-365372</guid>
		<pubDate>Fri, 19 Aug 2005 15:09:41 -0800</pubDate>
		<dc:creator>phearlez</dc:creator>
	</item><item>
		<title>By: phearlez</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#365374</link>	
		<description>You know, it occurs to me I remember reading about some jerk getting a software patent for dealing with Y2K issues though the above simple  &quot;&lt;3 0=2000,&gt;30 1900&quot; method. If I get sued over this I&apos;m sending you the bill, muckster!&lt;/3&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-365374</guid>
		<pubDate>Fri, 19 Aug 2005 15:12:52 -0800</pubDate>
		<dc:creator>phearlez</dc:creator>
	</item><item>
		<title>By: muckster</title>
		<link>http://ask.metafilter.com/22798/Batch-EXIF-Tagging#365401</link>	
		<description>COMPLETELY FREAKIN&apos; AWESOME! phearlez, you RULE! We&apos;re talking about something like 30,000 photos here, and all I have to do now is drop this .exe file in there and let it do its thing. I&apos;m blown away. It&apos;s working like a charm. This couldn&apos;t be easier. Thanks a TON!</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.22798-365401</guid>
		<pubDate>Fri, 19 Aug 2005 15:47:04 -0800</pubDate>
		<dc:creator>muckster</dc:creator>
	</item>
	</channel>
</rss>
