Merge pull request #9760 from Sakura-Luna/refresh
Fix gallery not being refreshed correctly
This commit is contained in:
commit
879ed5422c
|
@ -59,6 +59,7 @@ def image_from_url_text(filedata):
|
|||
is_in_right_dir = ui_tempdir.check_tmp_file(shared.demo, filename)
|
||||
assert is_in_right_dir, 'trying to open image file outside of allowed directories'
|
||||
|
||||
filename = filename.rsplit('?', 1)[0]
|
||||
return Image.open(filename)
|
||||
|
||||
if type(filedata) == list:
|
||||
|
|
|
@ -2,6 +2,7 @@ import os
|
|||
import tempfile
|
||||
from collections import namedtuple
|
||||
from pathlib import Path
|
||||
from time import time
|
||||
|
||||
import gradio as gr
|
||||
|
||||
|
@ -34,6 +35,7 @@ def check_tmp_file(gradio, filename):
|
|||
def save_pil_to_file(pil_image, dir=None):
|
||||
already_saved_as = getattr(pil_image, 'already_saved_as', None)
|
||||
if already_saved_as and os.path.isfile(already_saved_as):
|
||||
already_saved_as += f'?{int(time())}'
|
||||
register_tmp_file(shared.demo, already_saved_as)
|
||||
|
||||
file_obj = Savedfile(already_saved_as)
|
||||
|
|
Loading…
Reference in New Issue