Member
Member
tancrede   2009-02-22, 11:15
#1
Hi,

I just wanted to know if it is possible to write things like tags or description in the imge files after a zenphoto editing process.

Thanks for your answers,

T.
Administrator
Administrator
acrylian   2009-02-22, 11:46
#2
No, the GDlib does not support meta data.
Unregistered
Unregistered
Guest   2009-08-12, 13:32
#3
@tancrede
I came up with a hack to solve this:
1. download the "IPTC EASY 1.0" class from the comments on http://us2.php.net/manual/en/function.iptcembed.php
2. Save as iptc.php in the zp-core folder in your zenphoto install
3. add the following code, immediately before the line `$tags = array_flip(array_diff($tagsLC, $existing));` in your functions.php file:

`
$filename = query_single_row("SELECT filename FROM ".prefix('images')." WHERE id = '".$id."'");
$albumid = query_single_row("SELECT albumid FROM ".prefix('images')." WHERE id = '".$id."'");
$folder = query_single_row("SELECT folder FROM ".prefix('albums')." WHERE id = '".$albumid['albumid']."'");
$iptc = new iptc(SERVERPATH.'/albums/'.$folder['folder'].'/'.$filename['filename']);
$iptc->set(IPTC_KEYWORDS,implode('; ',$tags));
$iptc->write();
`
Member
Member
sbillard   2009-08-12, 16:19
#4
You might be better off making this a plugin that handles the `save_image_custom_data` filter. Then you don't have to modify the core files. In addition, the album and image names are redily available to you from this filter, no querys needed.

Also, just a warning to anyone wishing to use this code. There is a function to get the name of the albums folder which should be used. Otherwise if you do not have the "standard" folder name this code will fail.
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.