ReptarX / pyfpdf

Automatically exported from code.google.com/p/pyfpdf
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Use imghdr.what to identify filetype on image instead of splitting on '.' #24

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It's unreliable splitting on the filename dot. In my case I had a URL like:
http://www.example.org/image.png?asdg=asdf and it thought "png?asdg=asdf" was 
the file ending. With .what you can give it the binary stream and it'll 
identify the file format for you.

Original issue reported on code.google.com by kitsu...@gmail.com on 13 Sep 2012 at 8:58