CPG does not properly handle keywords with embedded spaces. Suppose I have a keyword "Sugar Maple" to identify a kind of tree. CPG turns that into "Sugar" and "Maple" - two keywords instead of one. The problem manifests itself in the keyword search feature in the detailed image info form. Instead of "Suger Maple" showing up as a single search link, "sugar" and "maple" are displayed as separate search links - each link searching only for the individual word "sugar" or "maple" respectively.
Other examples where spaces will be embedded in keywords are band names (Van Halen, Def Leppard, Goo Goo Dolls, The Who, Grateful Dead), names and titles (Wolfgang Amadeus Mozart, Prime Minister, Vice President), landmarks (Grand Canyon, Eiffel Tower, Big Ben, Machu Picchu), country/ state names and continents (South Korea, North Dakota, South America, East Timor), etc. As you can see, this is a serious problem for stock photographers like me. We need a reliable search engine where our clients can search our image gallery and accurately find things.
The keywords are properly stored in the original image files and correctly extracted into the initial iptc array in includes/iptc.inc.php. Later calls to implode in include/picmgmt.inc.php and upload.php before storing in the pictures table use a space as the glue string to flatten out the keywords array into a varchar string. This is where the problem gets introduced. From there on, it is impossible to determine which spaces were originally embedded in keywords and which were used as glue strings. I suggest using a semi-colon as the glue string. Many programs use it as a delimiter when entering multiple keywords. I'm sure code will have to be changed in numerous places to correct this problem and support using the semi-colon delimiter (and creating proper search links in the detailed image info form).
UPDATE:
I figured out a pattern for preg_replace() in displayimage.php to properly parse using a semi-colon delimiter for keywords. The pattern should be /([^;]+)/, which matches one or more of anything but a semi-colon. This allows commas to be embedded in keywords just in case someone wanted to use it - for example "Washington, DC", "Dr. Neil Clark Warren, Ph.D" or "Dale Earnhardt, Jr" are valid keywords with commas in them.