rwcarlsen / goexif

Decode embedded EXIF meta data from image files.
BSD 2-Clause "Simplified" License
627 stars 134 forks source link

Make StringVal stop at first NULL #36

Open op opened 9 years ago

op commented 9 years ago

I'm a bit unsure what the best solution for ASCII fields are but this feels like a sane approach for most fields. Previously StringVal() would return the raw value of the tag without any stripping of \x00.

For special fields like eg. Copyright, this doesn't work perfectly and a user would need to access the .Val. Though, I think the API makes more sense now since it will return the string value.

For the MakerNote test case change, it seems like that particular image is encoded with MakerNote as ASCII compared to all the others which are encoded as Undefined which is the expected.

xor-gate commented 7 years ago

@op It seems the author is not very active in this project anymore, many forks have been created. I would like to make this stable and I created goexif2 which integrates your patch: https://github.com/xor-gate/goexif2/commit/34c409c8b3b8edb8d17ff4317a7bc174cbac027b