mariocesar/sorl-thumbnail — pull request #233 by radiosilence (2014-02-19 12:20:22+00:00)
Title: is_portrait failing for EXIF tag based portrait images.

Really sorry I didn't have time to write any tests! Here's the image that was screwing things up for me.

Essentially the issue is whilst doing a thumbnail caused engine._orientation to be called, which does the flip, this was not done on the original image (and thus the |is_portrait filter is incorrect). Doing _orientation on the original image is wasteful and silly, so what I've done is take the logic from orientation that decides whether to rotate +/- 90deg and popped it in another function, _flip_dimensions. This is then called when get_image_size is done.

Here's an image that fails:

http://files.blit.cc/DSC01135_2.JPG