mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Added autorotation of images
This commit is contained in:
parent
2e6f495305
commit
3736be58bc
@ -740,6 +740,9 @@ class HTMLConverter(object):
|
||||
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…
x
Reference in New Issue
Block a user