if image on disk was deleted between being generated and request being completed, do use temporary dir to store it for the browser
This commit is contained in:
parent
aa12dfada0
commit
bb11bee22a
|
@ -14,7 +14,7 @@ Savedfile = namedtuple("Savedfile", ["name"])
|
|||
|
||||
def save_pil_to_file(pil_image, dir=None):
|
||||
already_saved_as = getattr(pil_image, 'already_saved_as', None)
|
||||
if already_saved_as:
|
||||
if already_saved_as and os.path.isfile(already_saved_as):
|
||||
shared.demo.temp_dirs = shared.demo.temp_dirs | {os.path.abspath(os.path.dirname(already_saved_as))}
|
||||
file_obj = Savedfile(already_saved_as)
|
||||
return file_obj
|
||||
|
|
Loading…
Reference in New Issue