This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to preserve xmp metadata when resizing jpg images  RSS feed

 
Arnar Nesset
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

I have a project where I'm required to read jpg images to extract their xmp metadata and downsize them if required. The images will be stored as byte arrays. I can extract the xmp data fine and I can resize the image fine, but the metadata is lost on the way.

I use ImageIO.read(file) to get a BufferedImage which I might resize if it is too large for our storage. I then convert this BufferedImage into a byte array and pass this to the storage object (which requires a byte array). But the xmp data I extracted before resizing the image are not preserved when using BufferedImage, the BufferedImage class seems to be concerned with the actual image data only. Are there alternatives that will let me resize and preserve the metadata, or do I have to somehow write the metadata into the byte array I have after resizing?


Regards,

Arnar Nesset
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!