Rank: Member
Groups: Member
Joined: 7/7/2004(UTC) Posts: 14
|
Hi, I'm extracting the IptcKeyword field from the following image: http://www.getjealous.com/01_sRGB.jpg There are multiple keywords for the image: black and white blonde classic fireplace floor interior living room romantic Sheller terrace house timber timber floor white When I get the keywords out of the request (using php: $HTTP_POST_VARS[IptcKeyword_1]) they are one long string, with each keyword seperated by a string: black and white blonde classic fireplace floor interior living room romantic Sheller terrace house timber timber floor white Since there are keywords with spaces, there is no way to find out what they individual keywords are. Is there anyway to get this list. Is there any way you know that I can get around this so that i can loop through each keyword? Thanks, George Edited by user Sunday, August 31, 2008 7:15:29 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration, Moderator Joined: 7/28/2003(UTC) Posts: 1,659
Thanks: 5 times Was thanked: 76 time(s) in 74 post(s)
|
Hello George, I confirm the problem in design. There is no way to extract the keywords with spaces using our syntax. We will think about workaround in future version. |
Best regards, Fedor Skvortsov
|
|
|
|
Rank: Member
Groups: Member
Joined: 7/7/2004(UTC) Posts: 14
|
Thanks Fedor, I have achieved this by parsing the image on the server side. For anyone else using Java who needs to acomplish this, you can use the MetaData Extraction library from http://www.drewnoakes.com/code/exif/ and the following code: File jpegFile = new File("C:/stuff/My Documents/Content/01_adobeRGB.jpg"); try { Metadata metadata = JpegMetadataReader.readMetadata(jpegFile); // iterate through metadata directories Iterator directories = metadata.getDirectoryIterator(); while (directories.hasNext()) { Directory directory = (Directory) directories.next(); if (directory.containsTag(IptcDirectory.TAG_KEYWORDS)) { try { for (String s:directory.getStringArray(IptcDirectory.TAG_KEYWORDS)) { System.out.println(s); } } catch (MetadataException e) { e.printStackTrace(); } } } } catch (JpegProcessingException e) { e.printStackTrace(); } Edited by user Wednesday, August 27, 2008 3:01:05 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration, Moderator Joined: 8/3/2003(UTC) Posts: 1,070
Thanks: 1 times Was thanked: 12 time(s) in 12 post(s)
|
Hello George, Thank you for your sample. We will consider implementing this feature in the future versions. |
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration, Moderator Joined: 8/3/2003(UTC) Posts: 1,070
Thanks: 1 times Was thanked: 12 time(s) in 12 post(s)
|
|
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.