From 3736be58bc91ec1a9c1c2ecaebe5856eab346d7c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 18 May 2007 18:34:47 +0000 Subject: [PATCH] Added autorotation of images --- src/libprs500/ebooks/lrf/html/convert_from.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libprs500/ebooks/lrf/html/convert_from.py b/src/libprs500/ebooks/lrf/html/convert_from.py index e0fa5aa0b7..d019275b16 100644 --- a/src/libprs500/ebooks/lrf/html/convert_from.py +++ b/src/libprs500/ebooks/lrf/html/convert_from.py @@ -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