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

Error using id_filename on certain files with non-ascii letters in magic string #21

Open
hile opened this issue Jul 11, 2019 · 1 comment

Comments

@hile
Copy link

hile commented Jul 11, 2019

I have one JPEG file which can't be parsed with id_filename. I guess it contains copyright sign in non-unicode format?

file artwork.jpg
artwork.jpg: JPEG image data, JFIF standard 1.01, resolution (DPCM), density 59x59, segment length 16, comment: "File written by Adobe Photoshop� 5.0", baseline, precision 8, 200x200, frames 3

python -c 'import magic; magic.Magic().id_filename("artwork.jpg")'
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/site-packages/magic/identify.py", line 29, in wrapper
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/magic/compatability.py", line 30, in wrapper
return func(*encoder(args), **kwargs)
File "/usr/local/lib/python3.7/site-packages/magic/compatability.py", line 56, in wrapper
return value.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa8 in position 131: invalid start byte

@urwithajit9
Copy link

Hi Hile,
Can you share the artwork.jpg? I want to reproduce the error to work on it.

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

2 participants