IPTC patch for Gallery 1.3.3

© 2003 by Tim Strehle <tim@digicol.de>

Gallery is a great web based photo album written in PHP. I have created a patch for the version 1.3.3 that makes Gallery read IPTC metadata from JPEG images while they are added to an album. IPTC Headline and IPTC Caption are added to the Gallery Caption, other IPTC field contents are put into the Gallery Keywords.

This patch is outdated, it will not work with current versions of Gallery. So it probably won't be of any use to you. (Somebody made a working patch for version 1.3.4, which is available here, but this version is outdated, too.)

"IPTC JPEG File Information" is a standard by the International Press Telecommunications Council in wide use by news agencies and professional photographers. You can view or edit IPTC information in JPEG images using Adobe Photoshop's File - Info dialog, or freeware tools like IrfanView (with the Iptc plugin), Exifer or the Windows shell extension IPTCExt. (If you are running Microsoft Windows XP, you probably already have some JPEG images with IPTC information on your hard disk: Check the "Full Moon over Red Dunes" picture in the C:\WINDOWS\Web\Wallpaper folder.)

For advanced users: Note that PHP has full (while currently poorly documented) read/write JPEG IPTC support with the iptcparse() and iptcembed() functions.

Feel free to contact me at tim@digicol.de with questions/comments.

Two ways to patch your Gallery sources

Choose one of the two ways described below to add IPTC support to your own Gallery installation. Make sure that you're running Gallery 1.3.3, my patch probably won't work on other versions and will break your Gallery installation instead!

Disclaimer: Use this patch at your own risk. I won't guarantee that it works, and I won't be held liable for any damage caused by it!

A) Replace Album.php and AlbumItem.php

Or B) - Use "patch" on the Unix/Linux command line

How to test

Gallery Screenshot showing IPTC headline after upload Simply add a new JPEG image containing IPTC metadata to any of your Gallery albums. This screenshot shows the Windows XP "Full Moon over Red Dunes" wallpaper after upload - the caption has automatically been read from the IPTC Headline. (Note by Steven Noreyko: When importing images from a local directory, you need to check the "use filename if no caption" checkbox if you want IPTC to be read.)

You may as well use this screenshot for testing, as it does contain some IPTC information. Have fun!