mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Avoid unnecessary creation of QApplication when running image rescaling in the conversion pipeline
This commit is contained in:
parent
ffc0dcd836
commit
5d8d9a794b
@ -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()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user