Språk

thomas marquart

Fotografi och IT

hacking igal

as you may have noticed, i use igal to create the static galleries for my pictures. for a while, i had thought about switching to a gallery software that can display the exif-information from the jpeg-files (date, aperture etc.). instead of switching, i just hacked igal (which is a perl script) a few minutes ago to fiddle the output of jhead into each slide. it even seems to work!

Can you tell me how you have

Can you tell me how you have done that? I am really interested!

sure, in the igal script I

sure, in the igal script I added the following line:
$line =~ s/<!--IMAGE-EXIF-->/`myexif $safenames[$i]`/ge;
at the place where the placeholders in the slidetemplate are replaced by the real content (around line 508).

Then I added <P class="center"><!--IMAGE-EXIF--></P> to my .igal/slidetemplate.html so that this text comes into the html for all new galleries. Whereever you put this text - the above perl-line will replace it with the exif data.

Final bit is the command "myexif" that is used in the above line. It simply a one-line shell script containing:
echo `jhead $1 | grep -ve "^File" | grep -v Camera\ make | sed s/$/\<br\>/ | grep -v \^\<`

So, it calls jhead (a readily available tool, see here) on the file in question, throws away some lines and adds <br> after each line. This would probably have to be adjusted slightly for the exif-data of your camera...

I hope that helped, but keep in mind that this is a simple and quick hack which may not work or mess things up in certain cases.

/thomas

Skriv ny kommentar

Innehållet i detta fält är privat och kommer inte att visas publikt.
  • Rader och stycken bryts automatiskt.
  • Webbadresser och e-postadresser görs automatiskt till länkar.

Mer information om formateringsmöjligheter

Prenumerera på innehåll

Fler sidor som jag driver