![]() |
|
iptc, tags - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: iptc, tags (/thread-4729.html) |
iptc, tags - tancrede - 2009-02-22 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. iptc, tags - acrylian - 2009-02-22 No, the GDlib does not support meta data. iptc, tags - Guest - 2009-08-12 @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(); ` iptc, tags - sbillard - 2009-08-12 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. |