Page 1 of 1
exif date from image in gallery
Posted: Fri May 23, 2008 2:32 am
by sonichouse
I am using Highslide JS in a static page for my photo album.
I currently hard code the date in the title attribute e.g.
Code: Select all
<a id="thumb5" href="/serendipity/uploads/photos/DSC00142.JPG" class="highslide" onclick="return hs.expand(this)">
<img src="/serendipity/uploads/photos/DSC00142.thumb.JPG" alt="Highslide JS"
title="<b>22-Aug-2006:</b> Tara being stalked by a heron in the Maldives." height="82" width="110" /></a>
<a id="thumb6" href="/serendipity/uploads/photos/DSC00379.JPG" class="highslide" onclick="return hs.expand(this)">
<img src="/serendipity/uploads/photos/DSC00379.thumb.JPG" alt="Highslide JS"
title="<b>14-May-2007:</b> The folks having fun in the sun after my brother's wedding in Cyprus." height="82" width="110" /></a>
If I know the image ID, how do I use the EXIF date information instead of hardcoding it ?
Re: exif date from image in gallery
Posted: Fri May 23, 2008 10:48 am
by garvinhicking
Hi!
Short answer: You can't.
Long answer: You would need to write your own Smarty function and register that in your template's config.inc.php, and then install the "Smarty markup" event plugin so that you can use smarty markup in your static pages. Then you could enter a code like:
Code: Select all
{makeGallery name="photos/DSC00142.jpg"}
and your templates config.inc.php would look something like this:
Code: Select all
function makeGallery($params, &$smarty) {
global $serendipity;
$res = serendipity_db_query("SELECT * FROM {$serendipity['dbPrefix']}images WHERE CONCAT(path, '/', name, '.', extension) = '" . serendipity_db_escape_string($params['name']) . '");
// print_r($res);
// More code here, access the functions of the include/functions_images.inc.php API
}
$serendipity['smarty']->register_function('makeGallery', 'makeGallery');
The makeGallery function could use the s9y API methods to access metadata (I believe you don't need my query at all, there should be a s9y function that can fetch an image by filename).
HTH,
Garvin
Posted: Fri May 23, 2008 11:14 am
by sonichouse
Thanks for that.
I'll stick with it manually for now until a Highslide plugin arrives

Posted: Fri May 23, 2008 3:09 pm
by judebert
Incidentally, Don was working on EXIF tags for his site. As I recall, we discovered that the PHP support for EXIF is very spotty, despite being included as a standard extension.
I wouldn't hold my breath or anything.
But maybe Don will have something to add to the discussion.
Posted: Fri May 23, 2008 4:09 pm
by sonichouse
judebert wrote:Incidentally, Don was working on EXIF tags for his site. As I recall, we discovered that the PHP support for EXIF is very spotty, despite being included as a standard extension.
I wouldn't hold my breath or anything.
But maybe Don will have something to add to the discussion.
Thanks, the extended info in the media library seemed to be populated with the correct information. Guess I was lucky

Posted: Fri May 23, 2008 5:07 pm
by Don Chambers
I have not messed with that in awhile - as Judebert mentioned, EXIF and IPTC support seems to vary considerably from one php install to another.
However, in this case, I am wondering if sonichouse could install the serendipity_event_imageselectorplus plugin then use its smarty variable $quickblog.exif.Date_Time? ie, something like this:
Code: Select all
<a id="thumb5" href="/serendipity/uploads/photos/DSC00142.JPG" class="highslide" onclick="return hs.expand(this)">
<img src="/serendipity/uploads/photos/DSC00142.thumb.JPG" alt="Highslide JS"
title="<b>{$quickblog.exif.Date_Time:</b>}; Tara being stalked by a heron in the Maldives." height="82" width="110" /></a>
I have no idea if that would work, but maybe its a step in the right direction (or, quite possibly, 3 steps in the WRONG direction)!! LOL
Posted: Fri May 23, 2008 5:36 pm
by sonichouse
Don Chambers wrote:I have no idea if that would work, but maybe its a step in the right direction (or, quite possibly, 3 steps in the WRONG direction)!! LOL
I think at the moment this is just too far down the garden path for me as I have just started to learn to walk
However, when/if I get up to pace then I will revisit this.
Thanks all.
/Steve