forked from openlp/openlp
some fixes
This commit is contained in:
parent
67a3a6dc08
commit
6f88ccb006
@ -137,10 +137,10 @@ class ImageManager(QtCore.QObject):
|
|||||||
print u'get_image:', name
|
print u'get_image:', name
|
||||||
log.debug(u'get_image %s' % name)
|
log.debug(u'get_image %s' % name)
|
||||||
image = self._cache[name]
|
image = self._cache[name]
|
||||||
if image.image_bytes is None:
|
if image.image is None:
|
||||||
image.priority = ProcessingPriority.High
|
image.priority = ProcessingPriority.High
|
||||||
self._clean_queue.put_nowait((image.priority, image))
|
self._clean_queue.put_nowait((image.priority, image))
|
||||||
while image.image_bytes is None:
|
while image.image is None:
|
||||||
log.debug(u'get_image - waiting')
|
log.debug(u'get_image - waiting')
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
return image.image
|
return image.image
|
||||||
@ -156,10 +156,10 @@ class ImageManager(QtCore.QObject):
|
|||||||
if image.image_bytes is None:
|
if image.image_bytes is None:
|
||||||
image.priority = ProcessingPriority.Urgent
|
image.priority = ProcessingPriority.Urgent
|
||||||
self._clean_queue.put_nowait((image.priority, image))
|
self._clean_queue.put_nowait((image.priority, image))
|
||||||
while self._cache[name].image_bytes is None:
|
while image.image_bytes is None:
|
||||||
log.debug(u'get_image_bytes - waiting')
|
log.debug(u'get_image_bytes - waiting')
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
return self._cache[name].image_bytes
|
return image.image_bytes
|
||||||
|
|
||||||
def del_image(self, name):
|
def del_image(self, name):
|
||||||
"""
|
"""
|
||||||
@ -212,13 +212,16 @@ class ImageManager(QtCore.QObject):
|
|||||||
if image.image is None:
|
if image.image is None:
|
||||||
print u'processing (image):', image.name, image.priority
|
print u'processing (image):', image.name, image.priority
|
||||||
image.image = resize_image(image.path, self.width, self.height)
|
image.image = resize_image(image.path, self.width, self.height)
|
||||||
if image.priority == ProcessingPriority.Urgent:
|
self._clean_queue.task_done()
|
||||||
image.priority = ProcessingPriority.High
|
if image.priority != ProcessingPriority.Urgent:
|
||||||
elif image.priority == ProcessingPriority.High:
|
if image.priority == ProcessingPriority.High:
|
||||||
image.priority = ProcessingPriority.Normal
|
image.priority = ProcessingPriority.Normal
|
||||||
else:
|
else:
|
||||||
image.priority = ProcessingPriority.Low
|
image.priority = ProcessingPriority.Low
|
||||||
self._clean_queue.put_nowait((image.priority, image))
|
self._clean_queue.put_nowait((image.priority, image))
|
||||||
|
return
|
||||||
|
if image.priority not in [ProcessingPriority.Urgent,
|
||||||
|
ProcessingPriority.Low]:
|
||||||
self._clean_queue.task_done()
|
self._clean_queue.task_done()
|
||||||
return
|
return
|
||||||
if image.image_bytes is None:
|
if image.image_bytes is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user