• Post Reply Bookmark Topic Watch Topic
  • New Topic

writing into meta-data

 
yehoshua susswein
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, I'm trying to save textural information into an image.
I know that the image meta-data does that, but I can't figure out
how to save the data into the meta-data.

can anyone give me simple code that saves the data in the meta-data
I also need to be able to extract the data.
I found a site http://www.drewnoakes.com/code/exif/ that exracts the data but not save in.
 
yehoshua susswein
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is my code (doesn't work):

i get an exception,
javax.imageio.metadata.IIOInvalidTreeException: JPEGvariety and markerSequence nodes must be present
at com.sun.imageio.plugins.jpeg.JPEGMetadata.mergeNativeTree(JPEGMetadata.java:1088)
at com.sun.imageio.plugins.jpeg.JPEGMetadata.mergeTree(JPEGMetadata.java:1061)
at playaround.IIOMetaDataWriter.run(IIOMetaDataWriter.java:59)
at playaround.Main.main(Main.java:14)



[ UD: added CODE tags ]
[ March 27, 2008: Message edited by: Ulf Dittmer ]
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what's going wrong, but the code mixes the JPEGvariety and markerSequence code blocks so that no markerSequence is added. Try fixing that and see if it helps.

You might also read the JPEG metadata specification and see if anything jumps out at you.
[ March 27, 2008: Message edited by: Ulf Dittmer ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!