• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

writing into meta-data

 
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 ]
 
Rancher
Posts: 43016
76
  • 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 ]
    Bookmark Topic Watch Topic
  • New Topic