Closed micahjon closed 6 years ago
Seeing this by way of https://www.npmjs.com/package/jpeg-autorotate
. Friendly ping
Thank you for letting me know. In version 2.0, I add some type checks. It's will resolve this issue. https://github.com/hMatoba/piexifjs/blob/2.0/src/utils.ts#L486
Could you re-open this issue, when you get the image that throw this error?
@hMatoba , glad to hear you're working on a 2.0.
In the meantime, I discovered that the reason there's no stack trace is that you're throwing a string instead of an Error object, e.g.
Missing stack trace:
throw "'pack' error"
Has stack trace:
throw new Error("'pack' error")
If you'd like, I can submit a PR. Just let me know
Could you send me PR?
Sure, just submitted one.
Hi, we're using Piexifjs in production at BeFunky (an online photo editor) and have been getting this error pretty often:
'pack' error. Got invalid type argument
I looked over the call sites of the
pack()
function, and my best guess is that the culprit is line 457, where_dict_to_bytes()
convertsraw_value
to an array if its a number, but not if its any other type (string, undefined, null, etc).I'll let you know if I'm able to get an actual stack trace, but I just wanted to pass this along in case it was an oversight. Thanks for this super handy library.