mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-22 14:14:58 +02:00
Added autorotation of images
This commit is contained in:
parent
2e6f495305
commit
3736be58bc
1 changed files with 3 additions and 0 deletions
|
|
@ -740,6 +740,9 @@ def scale_image(width, height):
|
|||
im = PILImage.open(path)
|
||||
if width == None or height == None:
|
||||
width, height = im.size
|
||||
if width > height:
|
||||
im = im.rotate(-90)
|
||||
width, height = im.size
|
||||
if height > self.profile.page_height:
|
||||
corrf = self.profile.page_height/(1.*height)
|
||||
width, height = floor(corrf*width), self.profile.page_height-1
|
||||
|
|
|
|||
Loading…
Reference in a new issue