Patching Gallery 1.5.1 to support ExifTool (and ignoring clicks)

cricalix

Joined: 2004-07-24
Posts: 9
Posted: Sun, 2006-01-22 16:00

ExifTool is a perl application that can get the EXIF data from just about any image format that's currently in use by digital cameras. I decided to make Gallery support this tool, so I could use PNGs, and have EXIF data available in photo properties. I have, at points, cursed the developers who decided to write a function and then NOT use the function - but reuse the logic of the function!

The code changes view_photo.php, util.php and lib/albumItem.php and also requires a new entry in config.php to point to the path of exiftool. There may be flaws in the code - but from my reading of the various functions, it should work just fine. It should be noted that this patch probably makes Gallery go pear shaped if you use it without adding exiftool to your server, but I'm not sure and haven't tested this. If your Gallery breaks, just revert the changes and see if you can fix the patch :p

A definite drawback at the moment is that hasExif() seems to get called all over the place, and generates an additional load - one such set of calls is if you have the triplet of navigation thumbnails engaged; the function is called for those nav images for some reason.

The patchset also has an optional patch for ignoring clicks from certain IPs - this lets me ignore clicks from my public DSL address etc on my own gallery.

The patchset can be found at http://www.cricalix.net/files/gallery151.cumulative.patch.tar where I'll possibly keep it updated if I find a better solution (forum software didn't like the .tar). Thought-process type stuff can be found at http://highlander.cricalix.net/archives/2006/01/22/hacking-gallery-151/1/

Login or register to post comments
ckdake
ckdake's picture

Joined: 2004-02-18
Posts: 2226
Posted: Tue, 2006-01-24 17:58

Neat, feel free to upload this to the patch tracker on sf.net if you like.

Login or register to post comments