diff kitten: Report errors converting images
This commit is contained in:
parent
2a9dc23c61
commit
fa3e173c18
@ -142,7 +142,7 @@ def is_image(path):
|
|||||||
@lru_cache(maxsize=1024)
|
@lru_cache(maxsize=1024)
|
||||||
def data_for_path(path):
|
def data_for_path(path):
|
||||||
ans = raw_data_for_path(path)
|
ans = raw_data_for_path(path)
|
||||||
if not is_image(path):
|
if not is_image(path) and not os.path.samefile(path, os.devnull):
|
||||||
try:
|
try:
|
||||||
ans = ans.decode('utf-8')
|
ans = ans.decode('utf-8')
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
|
|||||||
@ -230,11 +230,7 @@ class ImageManager:
|
|||||||
self.handler.cmd.gr_command(cmd)
|
self.handler.cmd.gr_command(cmd)
|
||||||
|
|
||||||
def convert_image(self, path, available_width, available_height, image_data, scale_up=False):
|
def convert_image(self, path, available_width, available_height, image_data, scale_up=False):
|
||||||
try:
|
rgba_path, width, height = convert(path, image_data, available_width, available_height, scale_up, tdir=self.tdir)
|
||||||
rgba_path, width, height = convert(path, image_data, available_width, available_height, scale_up, tdir=self.tdir)
|
|
||||||
except ValueError:
|
|
||||||
rgba_path = None
|
|
||||||
width = height = 0
|
|
||||||
return rgba_path, width, height
|
return rgba_path, width, height
|
||||||
|
|
||||||
def transmit_image(self, image_data, image_id, rgba_path, width, height):
|
def transmit_image(self, image_data, image_id, rgba_path, width, height):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user