Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle NUL-terminated ASCII strings. #40

Merged

Conversation

maltoe
Copy link
Contributor

@maltoe maltoe commented Jun 19, 2015

Hi @remvee

I admit I have no real idea of what I'm doing here as I did not read any EXIF specs or anything so far. Just came across a few JPEG files created by the GoPro HD2 where the make, model, and software tags returned some garbage after the actual value (as returned by other exif readers / exiv2). I assume GoPro is using the remaining bytes internally somehow since it does not look like a valid string in any encoding to me, and also not like encoding information.

The easy fix is to strip the strings after the NUL terminator, so unpack('Z*'). The change feels a bit dangerous, but all tests still pass and who am I to say this. Happy to come up with a "proper" solution if you point me to in the right direction.

Malte

The GoPro HD2 produces JPEG images with NUL-terminated tags (make,
model, software). Handle these properly.
@remvee remvee merged commit 80c7924 into remvee:master Jun 22, 2015
@remvee
Copy link
Owner

remvee commented Jun 22, 2015

Thank you for this changeset!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants