How to add EXIF dates to scanned photos or negative JPGs [SOLVED]
Brian McKee
brian.mckee at gmail.com
Fri Jan 1 16:48:18 UTC 2010
On Thu, 2009-12-31 at 14:08 -0500, Kim Briggs wrote:
> Hi List,
>
> I am posting a link to a script I came up with to add Exif meta-data
> to JPG files. Constructive criticism
> welcomed.
> http://kimbriggs.com/computers/computer-software/add-exif-date-scanned-photo-negative.file
Hi Kim
Couple of things I noticed... (I'm not a programmer, but have hacked up
a few lousy perl scripts before)
Perl scripts should always 'use strict' It can seem like a pain
cleaning up all the complaints it makes when you start, but in the long
run it really saves aggravation and time. For instance, it would have
pointed out you didn't define my_website anywhere before you used it :-)
Since strict makes you declare variables with 'my' I changed your
variable names - my my_date looks weird :-)
You need the 'glob' function to get a list of files across platforms.
I haven't tested this particular script on anything but Karmic.
No need to add a variable to a string to print it - just put the
variable inside the double quotes
I looped the repeated calls to set attributes, should make
adding/changing easier.
Quoting stuff to 'system' to get it to handle things like file names
with spaces is a pain - what I did works but I'm sure there's a better
way.
You should add a license of some sort - there was a recent link on the
list to some examples.
I ran it thru perltidy to get indenting going. Helps keep it readable.
As you point out, there's lots of error checking should be done here -
e.g. is the file a jpeg before we try and change it? - but I haven't
done any work on that.
Hope you find this constructive.
Brian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: addExif.pl
Type: application/x-perl
Size: 2275 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20100101/6d843290/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20100101/6d843290/attachment.sig>
More information about the ubuntu-users
mailing list