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

UnicodeEncodeError: 'ascii' codec can't encode character u'\xa9' #46

Closed
bgreen-litl opened this issue Feb 4, 2015 · 2 comments
Closed

Comments

@bgreen-litl
Copy link

Here's the image that causes the problem.

This seems to be a regression from 1.4.2 where process_file does not blow up on this image.

DEBUG JPEG format recognized data[0:2]=0xFFD8
DEBUG data[2]=0xFF data[3]=0xE1 data[6:10]=Exif
DEBUG Segment base 0x2
DEBUG APP1 at base 0x2
DEBUG Length: 0x34 0x24
DEBUG Code: Exif
DEBUG Decrement base by 2 to get to pre-segment header (for compatibility with later code)
DEBUG Endian format is I (Intel)
DEBUG IFD 0 (Image) at offset 8:
DEBUG ImageDescription: (0x010E) ASCII=Arion ater @ 158
DEBUG Make: (0x010F) ASCII=Canon @ 170
DEBUG Model: (0x0110) ASCII=Canon EOS-1D Mark IV @ 176
DEBUG XResolution: (0x011A) Ratio=240 @ 198
DEBUG YResolution: (0x011B) Ratio=240 @ 206
DEBUG ResolutionUnit: (0x0128) Short=Pixels/Inch @ 78
DEBUG Software: (0x0131) ASCII=Adobe Photoshop Lightroom 4.0 (Macintosh) @ 214
DEBUG DateTime: (0x0132) ASCII=2012:06:23 16:19:48 @ 256
DEBUG Artist: (0x013B) ASCII=Robert Muckley @ 276
Traceback (most recent call last):
File "./EXIF.py", line 131, in
main()
File "./EXIF.py", line 99, in main
data = process_file(img_file, stop_tag=stop_tag, details=detailed, strict=strict, debug=debug)
File "/Users/bob/src/exif-py/exifread/init.py", line 204, in process_file
hdr.dump_ifd(ifd, ifd_name, stop_tag=stop_tag)
File "/Users/bob/src/exif-py/exifread/classes.py", line 227, in dump_ifd
printable = str(values)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa9' in position 10: ordinal not in range(128)

@ianare
Copy link
Owner

ianare commented Feb 9, 2015

Please re-open if it still doesn't work.

If it's OK I will make a new release.

Thanks,

-- ianaré

@ianare ianare closed this as completed Feb 9, 2015
ianare added a commit that referenced this issue Feb 9, 2015
@bgreen-litl
Copy link
Author

Thanks. Works for me. A release would be great.

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