mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 12:48:36 +02:00
Remove IM from SNB Output
This commit is contained in:
parent
e25d1220f3
commit
9d72a1c3eb
1 changed files with 6 additions and 6 deletions
|
|
@ -228,10 +228,9 @@ def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
|||
snbFile.Output(output_path)
|
||||
|
||||
def HandleImage(self, imageData, imagePath):
|
||||
from calibre.utils.magick import Image
|
||||
img = Image()
|
||||
img.load(imageData)
|
||||
(x,y) = img.size
|
||||
from calibre.utils.img import image_from_data, resize_image, image_to_data
|
||||
img = image_from_data(imageData)
|
||||
x, y = img.width(), img.height()
|
||||
if self.opts:
|
||||
if self.opts.snb_full_screen:
|
||||
SCREEN_X, SCREEN_Y = self.opts.output_profile.screen_size
|
||||
|
|
@ -248,8 +247,9 @@ def HandleImage(self, imageData, imagePath):
|
|||
# TODO : intelligent image rotation
|
||||
# img = img.rotate(90)
|
||||
# x,y = y,x
|
||||
img.size = (x / scale, y / scale)
|
||||
img.save(imagePath)
|
||||
img = resize_image(img, x / scale, y / scale)
|
||||
with lopen(imagePath, 'wb') as f:
|
||||
f.write(image_to_data(img, fmt=imagePath.rpartition('.')[-1]))
|
||||
|
||||
if __name__ == '__main__':
|
||||
from calibre.ebooks.oeb.reader import OEBReader
|
||||
|
|
|
|||
Loading…
Reference in a new issue