Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get summery of a jpeg file 2

Status
Not open for further replies.

timgerr

IS-IT--Management
Joined
Jan 22, 2004
Messages
364
Location
US
A friend asked me to write a program for a WIN32 OS. When this person’s camera takes a picture it populates the file summery with information (right click on the file, go to the summary tab). One field that I need to get is called "Date Picture Taken". I then need to rename the pictures with something incremented by 1 and this field. Is there a cpan module that can do this?

Thanks

-T


-How important does a person have to be before they are considered assassinated instead of just murdered?
-Need more cow bell!!!

 
I just downloaded EXIF.pm and did a few tests, but failed.

Here is my testing code (named as getImageInfo.pl) with line numbers:

Code:
1 #! /usr/local/bin/perl
2
3 use Image::EXIF;
4 use Data::Dumper;
5
6 my $srce = "./photo1.jpg";
7
8 my $exif = new Image::EXIF($srce);
9
10 my $image_info = $exif->get_image_info(); # hash reference
11 my $camera_info = $exif->get_camera_info(); # hash reference
12 my $other_info = $exif->get_other_info(); # hash reference
13 my $point_shoot_info = $exif->get_point_shoot_info(); # hash reference
14 my $unknown_info = $exif->get_unknown_info(); # hash reference
15 my $all_info = $exif->get_all_info(); # hash reference
16 print $exif->error ? $exif->errstr : Dumper($all_info);
17
18 print "\nExit...\n";
19 exit;

The error message from the first run:

Code:
% ./getImageInfo.pl
Can't locate auto/Image/EXIF/get_point_s.al in @INC (@INC contains: /usr/local/lib/perl5/5.6.2/i686-linux /usr/local/lib/perl5/5.6.2 /usr/local/lib/perl5/site_perl/5.6.2/i686-linux /usr/local/lib/perl5/site_perl/5.6.2 /usr/local/lib/perl5/site_perl .) at ./getImageInfo.pl [b]line 13[/b]

So, I commented out line 13 and ran it again:

Code:
% ./getImageInfo.pl
$VAR1 = undef;

Exit...

Could someone explain why I got these errors? BTW, the tests were done on linux/perl 5.6.2.

Many thanks!
 
Hi,

Looks to me as if the Image::EXIF installation didn't take properly.

Is the .al file mentioned in the error message there?

Before you allow the code to run further, could you check the success of:

my $exif = new Image::EXIF($srce);

This is where, as I'm sure you know, it creates the EXIF object. If you don't check the success of this call any problems will only show up later.

Mike

The options are: fast, cheap and right - pick any two... [orientalbow] & [anakin]

Want great answers to your Tek-Tips questions? Have a look at faq219-2884
 
Thank you, Mike, for your inputs.

I can not find the .al file anywhere using command 'find / -name \*.al'.

Though I know $exif is an object, I have to admit that Idon't how to test if it's created successfully. could you show me how?

I have run the installation again. Here are the steps what I did. For your convenience, the actual commands are in BOLD fonts. Sorry, a bit long, though.

Code:
% [b]cd Image-EXIF-1.00.3[/b]

% [b]ls[/b]
asahi.c  Changes                 exif.h      EXIF.xs   jpeg.o       makers.o   olympus.c    sanyo.c    test.prec
asahi.o  create_web_gallery.pl*  exifint.h   fuji.c    leica.c      MANIFEST   olympus.o    sanyo.o    timevary.c
blib/    EXIF.bs                 exif.o      fuji.o    leica.o      META.yml   panasonic.c  sigma.c    timevary.h
canon.c  exif.c                  EXIF.o      getopt.c  Makefile     minolta.c  panasonic.o  sigma.o    timevary.o
canon.o  EXIF.c                  EXIF.pm     getopt.o  Makefile.PL  minolta.o  pm_to_blib   tagdefs.c  t.pl
casio.c  exifgps.c               exifutil.c  jpeg.c    makers.c     nikon.c    README       tagdefs.o
casio.o  exifgps.o               exifutil.o  jpeg.h    makers.h     nikon.o    rename.pl*   test.pl

% [b]perl Makefile.PL[/b]
Writing Makefile for Image::EXIF

% [b]make[/b]
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   EXIF.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   asahi.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   canon.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   casio.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   exif.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   exifgps.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   exifutil.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   fuji.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   getopt.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   jpeg.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   leica.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   makers.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   minolta.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   nikon.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   olympus.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   panasonic.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   sanyo.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   sigma.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   tagdefs.c
cc -c   -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3   -DVERSION=\"1.00.3\" -DXS_VERSION=\"1.00.3\" -fpic "-I/usr/local/lib/perl5/5.6.2/i686-linux/CORE"   timevary.c
Running Mkbootstrap for Image::EXIF ()
chmod 644 EXIF.bs
rm -f blib/arch/auto/Image/EXIF/EXIF.so
LD_RUN_PATH="/usr/lib" cc  -shared -L/usr/local/lib EXIF.o asahi.o canon.o casio.o exif.o exifgps.o exifutil.o fuji.o getopt.o jpeg.o leica.o makers.o minolta.o nikon.o olympus.o panasonic.o sanyo.o sigma.o tagdefs.o timevary.o  -o blib/arch/auto/Image/EXIF/EXIF.so   -lexif
chmod 755 blib/arch/auto/Image/EXIF/EXIF.so
cp EXIF.bs blib/arch/auto/Image/EXIF/EXIF.bs
chmod 644 blib/arch/auto/Image/EXIF/EXIF.bs
Manifying blib/man3/Image::EXIF.3

% [b]make test[/b]
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl
1..1
# Running under perl version 5.006002 for linux
# Current time local: Thu Jan 18 10:03:01 2007
# Current time GMT:   Thu Jan 18 15:03:01 2007
# Using Test.pm version 1.24
ok 1

% [b]sudo make install[/b]
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/local/man/man3/Image::EXIF.3
Writing /usr/local/lib/perl5/site_perl/5.6.2/i686-linux/auto/Image/EXIF/.packlist
Appending installation info to /usr/local/lib/perl5/5.6.2/i686-linux/perllocal.pod

I have successfully installed perl modules many times before. And I could not see anything abnormal this time.

Please help! Thanks!!
 
if you are using windows you probably are usng activestate perl, in which case you can use ppm to easily install modules.

Try: Image::ExifTool

also reads and writes exif data.


- Kevin, perl coder unexceptional!
 
I just tried Image::ExifTool. It works very well. Thank you so much!

But do you think Image::EXIF.pm might have a bug so that it can not be run on linux?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top