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
Posts: 22
Well, I guess this is currently greatly impossible.
There is even no tool for writing EXIF headers in UNIX command line.
Posts: 397
I am also very much interested in this functionality, but no tool exists in Unix to embed data into a file you say??
Posts: 397
jhead and exiftag have limited write capabilities.
Posts: 43
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.
Posts: 70
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 ||
Posts: 22
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?
Posts: 22
OK, I was right, PEL is unableto create a new EXIF header in the image if it is missing.
draco2000, continue with Googling, please...
Posts: 22
However there is a *HACK* how to insert EXIF into the image:
http://platon.sk/forum/en/viewtopic.php?t=47
Posts: 174
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.....
Posts: 70
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 ||
Posts: 174
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.
Posts: 70
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
-Dan
|| G1 + G2 Hosting | Custom Theming | Donate to Gallery ||
Posts: 25
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
Posts: 2
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!
Posts: 174
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.
Posts: 1
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/$
Posts: 25
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:
Posts: 14
[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.
Posts: 3
Would it be possible to view and participate in the improvemente of this module?
Posts: 14
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.
Posts: 12
Just a few hints I got after Googling there and there ... maybe you already seen them but who knows ...
PHP code to get/modify IPTC data
http://www.phpscripts-fr.net/portions/portion.php?id=42
http://www.ozhiker.com/electronics/pjmt/library/list_contents.php4?show_fn=IPTC.php
http://pear.php.net/package/Image_IPTC/docs/1.0.2/apidoc/Image_IPTC-1.0.2/Image_IPTC.html
http://wiki.cc/php/Image_IPTC
http://www.exiv2.org/
A++
Posts: 26
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
Posts: 11
Yeah was looking for thesame question, especially to participate in the improvements..
Posts: 174
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.
Posts: 26
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 .
Posts: 26
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?!?!?
Posts: 23
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/
Posts: 7
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
Posts: 32509
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!
Posts: 23
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/
Posts: 1
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
Posts: 190
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.
Posts: 1
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?
Posts: 3
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
Posts: 4
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