Module: stadfed - Use Exif Data / Video Metadata for Title/Name and Description

mdunninger

Joined: 2013-05-24
Posts: 6
Posted: Sat, 2013-05-25 16:07

EDIT: Module is located here
EDIT: New version also includes ability to extract metadata from video files as well if it exists (requires ffmpeg of course)

I've done a little looking around in themes and the forum and I haven't yet found a solution for what I need. What I need is to have Gallery use the Title/Subject/Caption from the Exif data of each photo as that photo's title. I think it looks awful to have each photo's file name showing up as the title.

I know that I can edit each photo and change its title, but that seems like the very hard way to do this. When I add new photos, either by Server Add or just uploading from my computer, I want Gallery to extract the Exif data and use that as the default title.

I've activated the Exif and IPTC modules, to no avail. I'm using Gallery 3.0.7.

Thank you for your help!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2013-05-26 01:52

There is some workaround in this ticket:
http://sourceforge.net/apps/trac/gallery/ticket/608

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
mdunninger

Joined: 2013-05-24
Posts: 6
Posted: Sun, 2013-05-26 04:08

Thanks, Dave. I was really hoping there was an existing module or option so I don't have to muck around with the code.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2013-05-26 16:19

Did you test to see if it works? If it does one could just create a copy of the module and use that module instead of the default module.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
mdunninger

Joined: 2013-05-24
Posts: 6
Posted: Sun, 2013-05-26 17:20

I did try, and I didn't see any difference.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2013-05-27 14:06

Well I just tried and it worked for me.
This is an example image I tested with http://www.langleycom.com/gallery3/var/albums/Testing/EXIF_Data_Inside.jpg
The title became: Here goes title
& the Description became: Here goes description

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Mon, 2013-05-27 15:37

@mdunninger:

Give this module I whipped up a test and let us know if it worked out for you.

http://codex.galleryproject.org/images/0/07/Stadfed.zip

This module requires that the exif module is installed and activated.

Item Description will be populated from IPTC: Caption if it exists
Item Title will be populated from IPTC: ObjectName if it exists

Hope this helps.

(@Dave: just used your idea to copy from exif with the changes applied: just copied relevant functions)

 
Rarazor

Joined: 2013-05-28
Posts: 4
Posted: Tue, 2013-05-28 17:28

@jnash: really thank you for this module ! It was exactly what i'am looking for.
But something doesn't work with my Jpeg files :(
I make my photo with a Canon Powershot S100 and I use Microsoft Photo Gallery for add some description, tags, location...

Here a Jpeg file for example: http://r-allemann.fr/photos/var/albums/Vacances/2013_05_Cinque_Terre/2013_05_17_17_15_04_000003.jpg

If I look on table exif_records for this picture, I have that:

Quote:
a:17:{s:4:"Make";s:5:"Canon";s:5:"Model";s:20:"Canon PowerShot S100";s:8:"Aperture";s:3:"f/4";s:10:"ColorSpace";s:4:"sRGB";s:12:"ExposureBias";s:4:"0 EV";s:12:"ExposureTime";s:9:"1/400 sec";s:5:"Flash";s:8:"No Flash";s:11:"FocalLength";s:6:"5.2 mm";s:3:"ISO";s:3:"160";s:12:"MeteringMode";s:7:"Pattern";s:8:"DateTime";s:19:"2013:05:17 17:15:04";s:11:"Orientation";s:17:"1: Normal (0 deg)";s:14:"ResolutionUnit";s:4:"Inch";s:11:"xResolution";s:27:"180 dots per ResolutionUnit";s:11:"yResolution";s:27:"180 dots per ResolutionUnit";s:11:"Compression";s:16:"Jpeg Compression";s:12:"ExposureMode";s:1:"0";}

... without any description :(
I don't understand why.... The description should be here... No ? Thanks for help !

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Thu, 2013-05-30 13:26

All of that relies on the exif module. I'll check your image on mine and see what comes up. But perhaps the exif module needs to be updated. (or exif itself on the system) I'll let you know what I find out.

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Thu, 2013-05-30 13:32

Yes, same thing for me. Not showing. I'm guessing it's the exif/iptc library not pulling/storing the data.

Nothing I'm capable of tackling unfortunately.

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Thu, 2013-05-30 13:53

Theoretically, I could add this to my module, but accounting for all of the variations in the data and where it's stored, this could be a difficult process. The problem is, there isn't a 'standard' per se, on where this data is stored and by what tag.

 
mdunninger

Joined: 2013-05-24
Posts: 6
Posted: Thu, 2013-05-30 23:42

Thank you to everybody for the helpful responses. I've actually found that a different photo gallery package meets my needs better, so I've switched from Gallery.

 
Rarazor

Joined: 2013-05-28
Posts: 4
Posted: Sat, 2013-06-01 13:44

Hello mdunninger,
What do you choose finally ?

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Fri, 2013-06-14 16:37

Dave, think you can generate a codex template for this?

Thanks,
J

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2013-06-14 20:46

http://codex.galleryproject.org/Gallery3:Modules:stadfed
Edit away so we know what stadfed means :-)

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Fri, 2013-06-14 20:57

stadfed = that's easy!

Set Title And Description From Exif Data

Thanks by the way