Avoid unnecessary creation of QApplication when running image rescaling in the conversion pipeline

This commit is contained in:
Kovid Goyal 2014-07-12 13:57:08 +05:30
parent ffc0dcd836
commit 5d8d9a794b

View File

@ -17,10 +17,9 @@ class RescaleImages(object):
def __call__(self, oeb, opts): def __call__(self, oeb, opts):
self.oeb, self.opts, self.log = oeb, opts, oeb.log self.oeb, self.opts, self.log = oeb, opts, oeb.log
from calibre.gui2 import is_ok_to_use_qt self.rescale()
self.rescale(qt=is_ok_to_use_qt())
def rescale(self, qt=True): def rescale(self):
from calibre.utils.magick.draw import Image from calibre.utils.magick.draw import Image
is_image_collection = getattr(self.opts, 'is_image_collection', False) is_image_collection = getattr(self.opts, 'is_image_collection', False)
@ -91,6 +90,3 @@ class RescaleImages(object):
else: else:
item.data = data item.data = data
item.unload_data_from_memory() item.unload_data_from_memory()