Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!

  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to preserve xmp metadata when resizing jpg images  RSS feed

Arnar Nesset
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 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?


Arnar Nesset
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!