Open sjlongland opened 6 years ago
For the record, this is the work-around I'm using:
https://github.com/sjlongland/tornado-gallery/commit/a6d6a58acdc0ddbcac9a1f67a097ebd1647d68f0
That gives the following: http://gallery.longlandclan.id.au/meta/snowys-2018/20180415-dscf7010.jpg
Hi,
I recently stumbled on this looking for a way to parse EXIF in a photo gallery app. I'm using Tornado on Python 3.5, but hit a stumbling block in that the EXIF library gives me text as binary strings; I can't tell which are binary blobs and which are actual strings for me to decode.
As an example, take this photo: http://gallery.longlandclan.id.au/raw/snowys-2018/20180415-dscf7010.jpg
piexif
gives me this:Some of these are clearly human-readable text, but
MakerNote
for example, most definitely is not text. Both are represented withbytes
. I'd like to emit this data as JSON, howeverjson.dumps
takes great umbrage to the fact that I'm handing itbytes
objects. Is there a flag somewhere I can set that will decode the byte strings representing text intostr
objects?