Tool to write captions / descriptions / etc to IPTC/EXIF fields.

c0nsumer

Joined: 2002-07-25
Posts: 25
Posted: Thu, 2005-10-20 19:04

Hello,

I'm looking for someone to write a tool to write captions / descriptions / titles / etc to various IPTC and/or EXIF fields in the image files itself. Ideally this tool would be able to work against a selectable set of albums (on, say, a per-album basis) and automatically take the data assigned for the various G2 fields and write it to the selected IPTC and/or EXIF fields of the image files themselves.

I can see this being used in order to back up info set in G2 by essentially 'burning it in' to the files and I think would make for a great extension to Gallery...

So, is anyone able to do this, and if so, what would the charge be? I'd ideally like to donate to Gallery itself as payment, but this could be discussed.

Thanks!

-Steve

 
nepto
nepto's picture

Joined: 2004-07-06
Posts: 22
Posted: Sun, 2005-10-23 04:34

Well, I guess this is currently greatly impossible.

There is even no tool for writing EXIF headers in UNIX command line.

 
drhiii

Joined: 2003-04-27
Posts: 397
Posted: Sun, 2005-10-23 09:20

I am also very much interested in this functionality, but no tool exists in Unix to embed data into a file you say??

 
drhiii

Joined: 2003-04-27
Posts: 397
Posted: Sun, 2005-10-23 09:40

jhead and exiftag have limited write capabilities.

 
penfield888

Joined: 2004-03-02
Posts: 43
Posted: Sun, 2005-10-23 15:44

Steve, I realize this won't help with your old images, but I think that for the future, the easier approach would be the other way around - save the comments and captions to the image file and then extract them with Gallery. Since Gallery can already pull EXIF info, and since tools like Exifer already exist for editing exif info, you would be pretty far along.

Conceptually it's the contrary - Gallery becomes a presentation layer for the EXIF info, but that's easier because that becomes themeable and all that.

 
draco2002

Joined: 2003-04-28
Posts: 70
Posted: Sun, 2005-10-23 18:36

Impossible? nothing is impossible with a little googling ;)

http://pel.sourceforge.net/

The PHP EXIF Library (PEL) lets you manipulating EXIF (Exchangeable Image File Format) data. This is the data that digital cameras place in their images, such as the date and time, shutter speed, ISO value and so on.

Hope that helps.

-Dan

|| G1 + G2 Hosting | Custom Theming | Donate to Gallery ||

 
nepto
nepto's picture

Joined: 2004-07-06
Posts: 22
Posted: Mon, 2005-10-24 05:00

Well, I did not mean changing existing header, but creating a new one, what is more difficult. Last time I did research on this, I found that for example "jhead" is unable to do so. Software on your link seems to have a capabilities to create a new EXIF header in the image. Is there someone who actualy tried it?

 
nepto
nepto's picture

Joined: 2004-07-06
Posts: 22
Posted: Mon, 2005-10-24 05:10

OK, I was right, PEL is unableto create a new EXIF header in the image if it is missing.

draco2000, continue with Googling, please...

 
nepto
nepto's picture

Joined: 2004-07-06
Posts: 22
Posted: Mon, 2005-10-24 07:12

However there is a *HACK* how to insert EXIF into the image:

http://platon.sk/forum/en/viewtopic.php?t=47

 
doomdead

Joined: 2003-04-06
Posts: 174
Posted: Mon, 2005-10-24 17:14

I too am interested in having the ability for gallery to write g2 fields into exif data. As a way to backup and restore without loosing too much meta data. Say I drop an album and put it on cd/dvd and del it from gallery. then later i decide i want it back on there for whatever reason. having all my info there minus clicks would be great.

Second scenario would be for camera phones. I'd love to be able to add photos to gallery. fill out my album information and then let users save the photos and have it retain the data.....

 
draco2002

Joined: 2003-04-28
Posts: 70
Posted: Tue, 2005-10-25 14:44

I guess the next question is, does it have to be EXIF?

there a lot of programs that can stick info into image files.

for example
http://steghide.sourceforge.net/

If you had a module that read and wrote this info would that help?

(also might be nice to have for copyrighting purposes)

|| G1 + G2 Hosting | Custom Theming | Donate to Gallery ||

 
doomdead

Joined: 2003-04-06
Posts: 174
Posted: Tue, 2005-10-25 16:03

im more interested in preserving/building exif data than hiding the data in the image. if the image gets skewed enough you usually lose that information.

 
draco2002

Joined: 2003-04-28
Posts: 70
Posted: Tue, 2005-10-25 17:29

fair enough.

I think the EXIF hack mentioned above could be finagled into doing what you want.
with not to much effort

if you have a default image you keep in the module directory and use it for the "te-" than you should be able to add the information to any jpg that doesn't have it.

also if you used the comments field you could store gallery info without having to compromise the Standard EXIF data

beastie# jhead lola.jpg
File name    : lola.jpg
File size    : 19727 bytes
File date    : 2005:10:25 17:58:29
Camera make  : SONY
Camera model : DSC-S40
Date/Time    : 2005:09:30 09:16:13
Resolution   : 100 x 140
Flash used   : No
Focal length : 11.5mm
Exposure time: 0.033 s  (1/30)
Aperture     : f/4.5
ISO equiv.   : 160
Whitebalance : Auto
Metering Mode: matrix
Exposure     : program (auto)
Jpeg process : Progressive
Comment      : This is the comment Feild that you may want to use
Comment      : G2_Summary: This is the summary
Comment      : G2_Title: This is the title
Comment      : G2_Keywords: Dragon,Bearded,Lola

-Dan

|| G1 + G2 Hosting | Custom Theming | Donate to Gallery ||

 
c0nsumer

Joined: 2002-07-25
Posts: 25
Posted: Wed, 2005-10-26 21:12

Yep, this is the same sort of thing I'm thinking of. Sorry I haven't been active around here, it seems I forgot to subscribe to the thread and sort-of forgot about it.

Now, the problem is getting someone to implement it... ;)

I've been looking, but I'm inexperienced enough with PHP that I'm not quite sure where to begin.

-Steve

 
volant

Joined: 2005-10-31
Posts: 2
Posted: Mon, 2005-10-31 21:01

I'm not sure if this fact would be helpful to the tool in question, but I'd like to point out that ImageMagick itself has Unix command line IPTC embedding capability.

Here's an example of extracting iptc data:
convert source.jpg 8BIMTEXT:iptc.txt

And here's an example of embedding that iptc data (held in a text file) into a jpg:
mogrify -profile 8BIMTEXT:iptc.txt destination.jpg

Any IPTC data that was there before is erased and replaced with the contents of the simply-formatted text file.

Hope this is useful!

 
doomdead

Joined: 2003-04-06
Posts: 174
Posted: Mon, 2005-10-31 21:24

so if gallery dumped the iptc profile to a text file, replaced the comments field with g2 data, then put it back into the jpg. we would be set.

 
jkochans

Joined: 2004-08-01
Posts: 1
Posted: Thu, 2005-11-03 02:38

Folks:

It appears that a simple call to jhead using the "-ci" command can add comments if you simply put the "comments" you want into a file first. The "hack" below shows exactly how to do it:

/command/$ jhead IMG_1712.jpg
File name : IMG_1712.jpg
File size : 3045662 bytes
File date : 2005:10:16 09:41:44
Camera make : Canon
Camera model : Canon EOS DIGITAL REBEL
Date/Time : 2005:01:30 14:19:14
Resolution : 3072 x 2048
Flash used : Yes
Focal length : 18.0mm (35mm equivalent: 29mm)
CCD width : 22.66mm
Exposure time: 0.017 s (1/60)
Aperture : f/4.0
ISO equiv. : 400
Metering Mode: matrix
Jpeg process : Baseline

/command/$ echo "Example DESCRIPTION: Hello test" > xx
/command/$ echo "Example TITLE: Great Picture" >> xx
/command/$ jhead -ci xx IMG_1712.jpg
Modified: IMG_1712.jpg

/command/$ jhead IMG_1712.jpg
File name : IMG_1712.jpg
File size : 3045727 bytes
File date : 2005:11:02 21:35:16
Camera make : Canon
Camera model : Canon EOS DIGITAL REBEL
Date/Time : 2005:01:30 14:19:14
Resolution : 3072 x 2048
Flash used : Yes
Focal length : 18.0mm (35mm equivalent: 29mm)
CCD width : 22.66mm
Exposure time: 0.017 s (1/60)
Aperture : f/4.0
ISO equiv. : 400
Metering Mode: matrix
Jpeg process : Baseline
Comment : Example DESCRIPTION: Hello test
Comment : Example TITLE: Great Picture

/command/$

 
c0nsumer

Joined: 2002-07-25
Posts: 25
Posted: Thu, 2005-11-03 13:54

I don't mean to jump the gun and prod people the wrong way, but I'll throw $50 to the Gallery coffers the moment I see a workable module which allows one to write item metadata to IPTC headers.

What I imagine would work best is a series of side-by-side drop down menus and a selection (similar to the migration one) where one can select which albums this process is run against. The drop down menus would allow one to pick the Gallery metadata (say, Description) and pair it up with the IPTC field it should be applied to.

Think of something like this:

Gallery Metadata  |  IPTC Metadata
------------------+------------------
Summary           >  Caption
Title             >  Tile
Keywords          >  Keywords
 
ColoredPixels

Joined: 2005-09-30
Posts: 14
Posted: Fri, 2005-11-04 23:39

[copying another post of mine]
Can it be done, yes. The primary tool to get it working would be ExifTool by Phil Harvey which is able to read and write tags in many formats, including EXIF, GPS, IPTC, and Photoshop IRB. It is a perl command line tool, but should not be too hard to integrate. Simply write all your changes to a text file, and then use the -TagsFromFile option to insert them. From there, it is just writing html forms showing what it available, and processing checkmarks as to what to copy.

If nobody gets to it sooner, I might be able to get at doing it in December. My plate is a little full at the moment.

[EDIT]
Ok. So got started on this. I am about 60% done. I started with the html side first, which is a pain when having to do it in 5 different languages. Here are the screen shots. Edit Captions and EXIF/IPTC Admin

The work I am doing is setup to only edit 1(well 9) pictures at a time. It does not process the whole album recursively. That can be worked on later, but has the pitfalls of do you append or overwrite data, and how do you control which order multiple tags are added to a field.

 
dankajh

Joined: 2005-11-11
Posts: 3
Posted: Fri, 2005-11-11 16:11

Would it be possible to view and participate in the improvemente of this module?

 
ColoredPixels

Joined: 2005-09-30
Posts: 14
Posted: Fri, 2005-11-11 21:24

Not easily at the moment. I have a tendency to stomp on core functions, get something working, and then migrate the functions out into the module as I find room to wiggle. Right now, If I gave you a copy of my changes, it would corrupt your install. Not all of the files I am changing can be placed in a local directory. Give me about two weeks, and I should have something more friendly. As soon as I do, I will send you a PM.

In other discussions, I have found another php EXIF library that I may be able to use, so I have to go off and investigate that as well. Using it would negate the need to call an external perl script for the EXIF writing.

 
hybrid256

Joined: 2006-02-21
Posts: 12
Posted: Sat, 2006-03-25 14:27
 
steveman2000

Joined: 2006-04-08
Posts: 26
Posted: Sat, 2006-04-08 03:49

Saving the data stored in the gallery database to IPTC & EXIF tags in the original image file? This is what I need and am in fact desperate for.

I may be willing to help the creation of such a modules in about 6/7 weeks time when I graduate if people want help.

My situation
I'm an image manipulation/photography (serious) emphusiast. I have 10 gigs of images and growing. Organising the number of images is a night mere and completely impossible.

I like to be able to easily see what I have therefore I prefer to only have one level of categories.
I also like to have images in more than one place without duplicating them.
I never know what image organising system might be available tommorrow.
I want to be able to get image details into any application (web based, or desktop) without re-writing the details of every image.

Solution
The only solution of where to store the image details is therefore in IPTC (and EXIF) tags within the image file itself.
The only solution of how to manage the images is to put images into categories using key words and to have search folders.

Futher more
This problem is driving me mad, and i've spend literally HOURS of my time searching for programs (web based or desktop) that will do this. I have found some but theres always a problem e.g. they don't ACTUALY do this (picasa).

Being a final your student studying computer science I have little money (more or less none) to buy software and no time to write it myself.

--
Website: http://me.sllewellyn.com
Gallery: http://www.something-beautiful.org/mygallery

 
photopix

Joined: 2006-04-28
Posts: 11
Posted: Fri, 2006-04-28 22:43
dankajh wrote:
Would it be possible to view and participate in the improvemente of this module?

Yeah was looking for thesame question, especially to participate in the improvements..

 
doomdead

Joined: 2003-04-06
Posts: 174
Posted: Wed, 2006-05-03 15:46

There is a program out there, that can batch generate tags for your images and embed them, based off filename, directory, timestamp, etc. I think its exactly what your looking for. Now. If only I could remember what it was. I'll look around.

 
steveman2000

Joined: 2006-04-08
Posts: 26
Posted: Wed, 2006-05-03 17:33
wdekreij wrote:
steveman2000 wrote:
Saving the data stored in the gallery database to IPTC & EXIF tags in the original image file? This is what I need and am in fact desperate for.

I may be willing to help the creation of such a modules in about 6/7 weeks time when I graduate caravan attributen if people want help.

My situation
I'm an image manipulation/photography (serious) emphusiast. I have 10 gigs of images and growing. Organising the number of images is a night mere and completely impossible.

I like to be able to easily see what I have therefore I prefer yoga instituut to only have one level of categories.
I also like to have images in more than one place without duplicating them.
I never know what image organising system might be available tommorrow.
I want to be able to get image details into any application (web based, or desktop) without re-writing the details of every image.

Solution
The only solution of where to store the image details is therefore in IPTC (and EXIF) tags within the image file itself.
The only solution of how to manage the images is to put images into categories using key words and to have search folders.

Futher more
This problem is driving me mad, and i've spend literally HOURS of my time searching for programs (web based or desktop) that will do this. I have found some but theres always a problem e.g. they don't ACTUALY do this (picasa).

Being a final your student studying computer science I have little money (more or less none) to buy software and no time to write it myself.

LOL, that's alomst the exact same situation I'm in! Only im just graduated last year ;)

Well I'm glad im not the only one (it seemed like i was) why dont we team up and keep each other informed about what we have found? Oh btw jsut incase you didnt already know IMatch and the Adobe lightbox (hasn't come out yet) would do the job but they cost money :(.

 
steveman2000

Joined: 2006-04-08
Posts: 26
Posted: Wed, 2006-05-03 17:42
doomdead wrote:
There is a program out there, that can batch generate tags for your images and embed them, based off filename, directory, timestamp, etc. I think its exactly what your looking for. Now. If only I could remember what it was. I'll look around.

Well its certainly better than nothing! However really i think i need a tagging system now merged into something that writes the headers. Can't remember if thats what I put. Basicly its a many-to-many relationship so ive found that a directory structure aint appropriate. I'm really surprised that with the number of digital users these days developers haven't jumped creating such software. I mean surely im not teh only one who has gigs of images?!?!?

 
mgeisler

Joined: 2005-09-18
Posts: 23
Posted: Sat, 2006-11-18 22:59

Hi there,

I'm the author of PEL (http://pel.sf.net/) and I would just like to pitch in that PEL can create entirely new Exif data in files. So I hope you guys would take another look at it :-)

I suggest going with the SVN code at the moment since it fixes some bugs that were released with version 0.8.

Martin Geisler — http://mgeisler.net/

 
Picturenet
Picturenet's picture

Joined: 2006-01-15
Posts: 7
Posted: Sat, 2007-01-20 04:17
Quote:
Steve, I realize this won't help with your old images, but I think that for the future, the easier approach would be the other way around - save the comments and captions to the image file and then extract them with Gallery. Since Gallery can already pull EXIF info, and since tools like Exifer already exist for editing exif info, you would be pretty far along.

In all of my important photos, my originals, I add IPTC info using Arles Image Web Page Creator. This program can add and edit IPTC and JPEG Comment, but only read Exif info. I usually embed info, explanantions, write stories, etc. using IPTC.

When uploading to Gallery, galery can extract the IPTC info into a description field, but it cannot then be edited by Gallery. If the info needs to be changed, it must be changed in the original on my laptop, then the whole photo re-uploaded. It would be therefore a benefit if people could edit the desciption directly in Gallery.

Is there any work being done to include this function, or other people who think this would be good?

Another point, Gallery reads it as text only. I usually write IPTC info in html, as some programs can extract it into a field, and I usually at least use <b> and <p> tags.

Steve Gallagher
http://www.picture.net
Gallery at http://www.gallery.photos.net

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2007-01-20 16:53

mgeisler

- g2 needs php4/php5 support. i took a quick look at PEL and it looks like it's PHP 5 only (e.g. exceptions).
- g2 needs IPTC / XMP / ... support as well. would be nice if we could use a single lib for all image metadata.
e.g. exiftool (perl / binary) does all that and is known to be pretty mature as well.

--------------
Enter the Gallery 2 Theme Contest today!

 
mgeisler

Joined: 2005-09-18
Posts: 23
Posted: Sun, 2007-01-21 21:52

Yes, you're correct, PEL only runs on PHP5 (I decided not to be put up with the semi-OOP support offered by PHP4 and made it PHP5 only).

You have a good point about bundling all the functionality into a single dependency, so I fully understand why PEL isn't right for the task.

Martin Geisler — http://mgeisler.net/

 
saschawenzlick

Joined: 2006-01-19
Posts: 1
Posted: Thu, 2007-07-12 00:22

Hi,
are there any news on this?
I am looking for a button like "write all your captions into the EXIF meta-data of your pictures" ;)
Would be great to have something like this. Otherwise, I'll download all my pix, dump the database and write some batch file to add the captions with a Win tool I downloaded...
Thank you guys and best regards,
Sascha

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Tue, 2007-08-28 14:07

Sascha,

I'm not sure if you already implemented a solution to your problem or not. I too had a similar need where I wanted to use Gallery2 as the interface to update the EXIF content of my photos. I wrote a quick perl script that uses the exiflist and exifedit tools from the EXIFUtils tool suite to update the "User Comment" EXIF field with the Title extracted from Gallery. I run this script whenever I want to "flush" the data in Gallery2 out to the EXIF headers of the photos. The script is well structured, and has access to all the data for a given photo item stored in Gallery. The script can be edited to do more powerful things, or take additional data from Gallery2 and update any EXIF field you'd like with it. Right now, I simply take the title and put it in the user comment field. Feel free to take a look. I've attached it here. It's a far cry from a "button" in the web interface, but it's certainly a great start.

 
tomgoskar

Joined: 2008-07-21
Posts: 1
Posted: Mon, 2008-07-21 09:50

I'm interested in writing info from the database to EXIF/IPTC from an archival point of view. Does anyone know if this is any nearer in G2?

 
tetenyi

Joined: 2005-12-15
Posts: 3
Posted: Sat, 2008-11-22 17:28

I wonder, if there is any update concerning the issue of: "Tool to write captions / descriptions / etc to IPTC/EXIF fields"?
It would be really convenient to be able to tie a bit more the images and the captions.

Thank you for your response:
Istvan

 
joshuamarcoe

Joined: 2009-06-04
Posts: 4
Posted: Fri, 2009-06-05 13:35

This is an old forum, so maybe someone did this already, but I created an Excel file that pulls metadata out of an Excel worksheet, then generates command line parameters for Exiv2, which can then be copied and pasted into a batch file and run, writing Exif and IPTC metadata right into your file, and that can then be harvested by Gallery 2 or 3 when uploading...

see this other forum for more detailed description:

http://gallery.menalto.com/node/87207