Page 1 of 1

IPTC Keyword phrases

Posted: Sun Nov 14, 2010 3:06 am
by Yoeld
Hello,

I am trying to extract from JPEG file the IPTC medatada. I have no problem doing that except with the Keywords field
If am referring to the tag 2#025:
I am using the code:

Code: Select all

for ($i=0; $i<$keywordcount; $i++) $keywords .= $iptc["2#025"][$i] . ",";
When I have single word keywords, then I have no problem: Italy, Greece, Belgium ... . But when I am having keyword phrases, like "The Netherlands", "United States", or "Pacific Ocean", then the extraction does not keep the phrases. I will get an list of arrays like:
[0]: Netherlands
[1]: United
[2]: The
[3]: States

etc... with no real control on the order of the elements.

Any suggestion what to do to keep the phrases as their orgin?

Thanks, Yoel

Re: IPTC Keyword phrases

Posted: Sun Nov 14, 2010 4:12 am
by saltwine
Hi Yoeld


If the keyword phrases have been stored in the array as separate elements, then there may not be a way to extract them out in their original format. Can we see the output of:

Code: Select all

<?php var_dump($iptc["2#025"]); ?>
... to be sure?

Re: IPTC Keyword phrases

Posted: Sun Nov 14, 2010 4:54 am
by Yoeld
Yes. With the var_dump, you will see single elements. That is exactly the problem.

I suspect it is a limitation of the php function iptcparse. Other application like photoshop or IDimager are able to recognize the keyword phrases.

I have been looking for this on google, trying to understand if this is a limitation of php. Unfortunately, I did not find anything mentioning it.

Did you experience this?

Thanks, Yoel