Hello all,
Firstly, let me say Zenphoto is fantastic. fills a real gap in the market. well done and thanks a million.
I've been looking at the Template Functions (
http://www.zenphoto.org/documentation/functions/_template-functions.php.html) and its not clear to me why image fields like Location,City and State have getMethods (getImageLocation,getImageCity and getImageState) but not the Credit or Copyright fields.
I'm using these fields as pseudo metadata fields, to store particular information about my images, and I need the Credit and Copyright fields because I've used up all the others!
Guidance much appreciated.
cheers
chw
Comments
http://www.zenphoto.org/documentation/functions/_functions.php.html#functiongetImageMetadata
or via the image class methods directly.
Depending on your php knowledge you can also share one field for several data using explode() and arrays.
Otherwise you will have to create a filter to add more fields like the example here:
http://www.zenphoto.org/documentation/plugins/_plugins---filter-custom_data.php.html
But of course, the custom data field is really the way to go for your problem. These other fields may well get overridden if, for instance, you do a refresh metadata. Generally speaking, coopting a specific field other that the custom_data field is just asking for trouble in the long run.
1) Sbillard, your comment about not using the specific fields concerns me a little. To clarify the fields I'm using are 'Location', 'City', 'State' and 'Country'. These are metadata fields, and I'm using them to store metadata about my images. Its not clear to me why you advise against that. Isn't that what these fields are for?
2) The custom_data field approach looks limited to me because I'd have to share that one field to capture my 4 pieces of metadata. Is my understanding of that correct? If so this would require my users to input the content using some field seperators (as suggested here http://www.zenphoto.org/suppor/topic.php?id=3193) which isn't ideal for them.
3) For accessing the credit field I tried to use the getImageMetadata() function in image.php of my theme but I get an empty array.
4) You mentioned using the image class method directly to get the credit field. How would I do that in image.php of my theme? using $_zp_current_image?
I'd appreciate your help with these questions.
Cheers
chw
2) If you need more fields you have to create a filter to get those. Example is the filter-custom_data plugin.
3) Of course if you have not enter anything or your image has not EXIF data. You did read this correctly? http://www.zenphoto.org/documentation/functions/_functions.php.html#functiongetImageMetadata
You have to pass the filename of the image.
Also see: http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintImageMetadata
4) Yes. http://www.zenphoto.org/documentation/classes/_Image.html
1) I understand I shouldn't coopt the EXIF fields (camera maker,camera model etc)because these fields could be overwritten by the embedded image metadata on upload.
I'm less clear about whether this also applies to the location/city/state/country/credit/copyright fields, not least because these fields - in contrast to the EXIF fields - are editable in the Administration backend.
So to double confirm, are you saying that the location/city/state/country/credit/copyright zenphoto fields will be overwritten for an image, if the uploaded image has IPTC metadata embedded in its header? I can't test this because I have no tools for setting an image's iptc metadata.
If this is the case, why are these fields editable in the backend whereas the EXIF fields are not?
2) I've looked further into the custom data filter as it sounds interesting. The ability to create new fields would as you say get around this issue.
I've installed the filter-custom-data plugin, and made sure it is enabled in the backend. But I don't see any difference when I edit and save or upload a new image? I was expecting to see some new fields?? I've assumed I don't have to edit admin-edit.php as that's already done for me?? i'm on version 1.2.6.
Can you clarify what it is I should be seeing, where and what I might be missing?
Much appreciated
chw
I'd really appreciate your input on my last post.
cheers
chw