Search This Blog

Camera settings

How do I capture the camera settings I used on each photo?

My camera, like most digital cameras, records a vast amount of information regarding the photograph along with the actual photo.  This additional information is stored along with the photo inside the digital file.  Because I record .jpg files, there is a standard format for this information, it's called Exchangeable image file format, or EXIF for short.  Windows, Linux, Mac and FreeBSD all have viewer programs that can reach inside a .jpg file

Knowing this is interesting enough, but I didn't really want to open up another program so I could see the stored EXIF information.  I wanted to automate a way to extract it and format it so I could easily include the pieces I thought were interesting.  That's when I discovered Phil Harvey's ExifTool. The only prerequisite is Perl 5.004.  The key that makes ExifTool so valuable is that everything it does can be controlled from the command line - no graphical interface.  Thanks to his hard work, I'm able to write a batch script that will process a chosen photo and create an HTML table out of the elements I select.

I wrote a very simple 4 line DOS batch file called exiftool.bat

@REM run exiftool
@echo off
perl \buck\exiftool.pl -h -Fnumber -LensID -FocalLength35efl -ExposureTime -ExposureProgram -ISO -ExposureCompensation -Flash "%~f1"
pause Press a key...


The third line wraps around due to formatting restrictions on this web page.  It is all one continuous line from perl to "%~f1".  This is the line where I tell ExifTool which data elements I want to extract.  That funny "%~f1" at the end tells the batch file to substitute the file name of the file I am sending to ExifTool.

Then, I tied the batch file to Windows Explorer by adding a shortcut to the batch file in the Send To menu. Microsoft conveniently provides Knowledge Base article 310270 which describes the process.  Basically, Start, Run, type sendto in the command box and drag a shortcut to the batch file into the SendTo folder.  In Windows 7, to open the SendTo folder, open Explorer, then paste the following into the address bar: %APPDATA%\Microsoft\Windows\SendTo

Once those pieces are in place, all I need to do is open up Windows Explorer, look in my photo folder which I keep set to view thumbnails and when I find a photo that I want to post on the blog, I right click, then choose Send To, and from there, I choose ExifTool.  Then the batch file tells ExifTool which data elements to extract and ExifTool makes an HTML table out of them for me.  Since this is a DOS window, Alt-Space, E (for Edit), M (for Mark text to copy) and I select the table.  Enter copies it to the clipboard.  I switch to Blogger, click the HTML button at the top left and then paste the table into the blog post.

No comments:

Post a Comment

The spammers have struck. Due to this I will be moderating all comments. Sorry for the hassle, but it's the only choice because I refuse to turn on word verification.

Blog Widget by LinkWithin