Hi,
I'm trying to get the "creation date" of an image:
http://ultradev.com.nmsrv.com/nova-1.jpg
Now, I have this code:
#!/usr/bin/perl
print qq|Content-Type: text/html \n\n|;
use Image::IPTCInfo;
my $file = '/home/www/images/test/nova-1.jpg';
my $k = Image::IPTCInfo->new( $file ); # || die Im
+age::IPTCInfo::Error();
# my $info = new Image::IPTCInfo('file-name-here.jp
+g');
# Check if file had IPTC data
unless (defined($k)) { die Image::IPTCInfo::Erro
+r(); }
print "DATE WAS: " . $k->Attribute( 'date created'
+ );
print "END";
..which is using this module:
http://search.cpan.org/dist/Image-IPTCInfo/IPTCInfo.pm
The only problem, is it never seems to find the right date :/
If I right click that file on Vista, then click "Properties", and then "Details" - it shows the date fine - Date Taken: 14/07/2004 03:24
Can anyone suggest why its not working as I'm expecting? I just keep getting this error:
user@server1 admin $ perl test.cgi
Content-Type: text/html
No IPTC data found. at test.cgi line 13.
TIA!
Andy
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.