scardine / image_size

Get image width and height given a file path using minimal dependencies (no need for PIL, libjpeg, libpng, etc)
MIT License
153 stars 45 forks source link

Update get_image_size.py #2

Closed Nolanlemahn closed 9 years ago

Nolanlemahn commented 9 years ago

So I was actually using this while I was working on a little game project - specifically one using the Ren'Py Visual Novel Engine.

To keep a long story short, while playtesting, I noticed that this Python module worked on my Mac machines, but not my Windows machines. As it turned out, Windows needs the b argument (and the argument doesn't hurt the UNIX side of things); it was reading the image files in text mode.

"Python on Windows makes a distinction between text and binary files"

The module definitely made my life easier - it certainly isn't something I would have wanted to do the research for.

scardine commented 9 years ago

Thanks!