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

Automate transcoding of userComment string value #117

Open
nhoizey opened this issue Nov 14, 2023 · 0 comments
Open

Automate transcoding of userComment string value #117

nhoizey opened this issue Nov 14, 2023 · 0 comments

Comments

@nhoizey
Copy link

nhoizey commented Nov 14, 2023

When I activate userComment extraction with userComment: true, I get an object like this (shortened):

{
  "userComment": {
    "0": 65,
    "1": 83,
    "2": 67,
    "3": 73,
    "4": 73,
    "5": 0,
    "6": 0,
    "7": 0,
    "8": 80,
    "9": 104,
    "10": 111,
    "11": 116,
    "12": 111,
    "13": 32,
    "14": 111,
    "15": 102,
    "16": 32,
    "17": 116,
    "18": 104,
    "19": 114,
    "20": 101,
    "20": 101
  }
}

This is a sequence of character codes, which we can translate to a string, for example with this code:

Object.values(output.userComment)
  .map((char) => String.fromCharCode(char))
  .join('');

Here, we get the string ASCII\0\0\0Photo of three.

It would be nice if:

  • we did get the string strait from exifr
  • the encoding part in the beginning would be removed
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

No branches or pull requests

1 participant