commons-imaging icon indicating copy to clipboard operation
commons-imaging copied to clipboard

IPTCParser now takes the raw bytes of an IPTCRecord element into account

Open ola-github opened this issue 11 years ago • 3 comments

The IPTCRecord supports a String value and raw bytes. When writing an IPTCRecord into the file the raw bytes are ignored and the string value is used only instead. This value is encoded in charset 8859-1. There is currently now way to use a different encoding then 8859-1.

The given change now uses the raw bytes if existent. if not then if falls back to the previous strategy (string value encoded as 8859-1)

My context:I am currently working on handling of IIM and XMP metadata in images and i need the capability to use a encoding different from 8859 im IIM. I would be happy to hear your opinions on the proposal.

ola-github avatar Jan 15 '15 14:01 ola-github

Hi Oliver, Thank you for your patch! I'm collecting all the waiting patches for Apache Commons-Imaging and employ them at http://sourceforge.net/p/albonubes/ I hope you forgive me that I use your patches for a child project. Maybe you give it a try? Michael

mgmechanics avatar Apr 03 '15 15:04 mgmechanics

I think from your description you have a valid use case for handling the encoding yourself, instead of letting the library use ISO-8859-1 only.

I started to rebase the branch locally, when I realized that the IptcRecord class actually lost the #getRawBytes() method. So we can't really merge the code any longer.

Not sure why it changed, but looks like we will have to either add it back, or find an alternative solution. Sorry @ola-github Let me know if you have any idea how to update the pull request.

kinow avatar Dec 23 '17 11:12 kinow

This needs a test.

garydgregory avatar Dec 23 '23 16:12 garydgregory