Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
george_burrows  
#1 Posted : Tuesday, August 26, 2008 5:25:26 PM(UTC)
george_burrows

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

Fedor  
#2 Posted : Wednesday, August 27, 2008 7:00:05 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

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
george_burrows  
#3 Posted : Wednesday, August 27, 2008 3:00:15 PM(UTC)
george_burrows

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

Dmitry  
#4 Posted : Sunday, August 31, 2008 7:15:02 PM(UTC)
Dmitry

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.
Sincerely yours,
Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!
Dmitry  
#5 Posted : Saturday, November 21, 2009 3:37:27 AM(UTC)
Dmitry

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)
Now the ImageUploader.MetaDataSeparator property can be used to define separator symbol for multiple tags.
Sincerely yours,
Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!
Users browsing this topic
Similar Topics
HOWTO: Parsing multiple IPTC data (Discussions – ActiveX/Java Uploader)
by george_burrows 8/26/2008 5:25:26 PM(UTC)
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.