Alos
Alos

Reputation: 2715

How to obtain picture metadata using perl, php

How do I obtain the metadata for a png or jpg image? I have a few thousand images that get processed by a perl script. One of the things that I need to be able to get from each image is the metadata for them.

The most important information is the date listed in bold. I would like to have a script I can run that will grab the date info from each of the pictures that I process. It would be ideal if it is in perl, but php would work too. this is running on a Linux system. Any help would be appreciated. Thank you

Here is an example of one of the images: alt text

Here is the metadata for this image:

Sep 30, 2010

849×571 pixels – 825KB

Filename: EA_A02_N_1-4_5mM_Xgal_7d_B.cropped.resized.grey.png

Camera: Canon

Model: Canon EOS DIGITAL REBEL XSi

ISO: 200

Exposure: 1/50 sec

Aperture: 2.8

Focal Length: 60mm

Upvotes: 2

Views: 2310

Answers (3)

NiL
NiL

Reputation: 285

You can use ImageMagick, it's good application that was used in Typo3 to retrieve image's MetaData. when you want to execute it, you can use the exec() or system() functions

Upvotes: 1

nedk
nedk

Reputation: 663

Check out ExifTool

Upvotes: 2

Poelinca Dorin
Poelinca Dorin

Reputation: 9703

In php you can use exif_read_data() function .

Upvotes: 2

Related Questions