Last active
December 19, 2015 06:59
-
-
Save sps/5915360 to your computer and use it in GitHub Desktop.
script for adding EXIF camera info for flickr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# | |
# Copyright (c) 2006 Sean P. Scanlon <sean.scanlon <-AT-> gmail.com> | |
# All rights reserved. | |
use strict; | |
use Getopt::Long; | |
use Image::MetaData::JPEG; | |
my %opt = (); | |
GetOptions(\%opt, 'file=s', 'make=s', 'model=s'); | |
foreach (qw(file make model)) { | |
if (! $opt{ $_ } ) { | |
print "$0: --file=file.jpg --make=Kodak --model=Hawkeye\n"; | |
exit; | |
} | |
} | |
# Create a new JPEG file structure object | |
my $file = new Image::MetaData::JPEG($opt{file}); | |
die 'Error: ' . Image::MetaData::JPEG::Error() unless $file; | |
$file->set_Exif_data({Make => [$opt{make}], Model => [$opt{model}]}, 'IFD0_DATA', 'ADD'); | |
$file->save($opt{file}); | |
exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment