Adding date to Photographs.
This is one of the common things that I want to do when I want to print the photos and its truely boring job to do given the fact that the Date Photo taken is already in the image taken by the Digital Photos. So finally I wrote a simple script to do this. Here it is for anyone who might be interested:
(Note you will need the program called anotate, written by me, posted earlier and exiftool)<pre style="padding-left: 30px;">
#!/usr/bin/perl <pre style="padding-left: 30px;">if ($#ARGV < 0 ) <pre style="padding-left: 30px;">{ <pre style="padding-left: 30px;">** print "$#ARGV \n"; <pre style="padding-left: 30px;"> print "Usage $ARGV[0] filename/dir\n"; <pre style="padding-left: 30px;"> exit -1; <pre style="padding-left: 30px;">} <pre style="padding-left: 30px;">@files = `find "$ARGV[0]" -iname "jpg" -print`; <pre style="padding-left: 30px;">$count = 1; <pre style="padding-left: 30px;">foreach $file (@files) { <pre style="padding-left: 30px;"> if ($flag) { <pre style="padding-left: 30px;"> # system("annotate "$date" "$file" "$file""); <pre style="padding-left: 30px;"> # } <pre style="padding-left: 30px;"> # else { <pre style="padding-left: 30px;"> @details = `exiftool '$file'`; <pre style="padding-left: 30px;"> foreach $det (@details) { <pre style="padding-left: 30px;"> @words = split(/ : /, $det); <pre style="padding-left: 30px;"> $_ = $det ; <pre style="padding-left: 30px;"> chomp($words[1]); <pre style="padding-left: 30px;"> if (/Date\/Time Original/ ) { <pre style="padding-left: 30px;"> $date =$words[1] ; <pre style="padding-left: 30px;"> **** <pre style="padding-left: 30px;"> } <pre style="padding-left: 30px;"> } <pre style="padding-left: 30px;"> } <pre style="padding-left: 30px;"> system("annotate "$date" "$file" "$file""); <pre style="padding-left: 30px;"> ** <pre style="padding-left: 30px;">* $count ++; <pre style="padding-left: 30px;">}** <pre style="padding-left: 30px;"> **** <p style="padding-left: 30px;">
Related Articles:
- 2010/02/10 Annotating the photograph with comments.
- 2010/01/21 Copy temporary evolution images downloaded for messages
- 2010/01/10 Remove Invalid characters in Filename.
- 2009/11/04 Photo Resizing
- 2009/10/12 Adding dates to your photos.
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.