Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,12 +19,16 @@ GALLERY_JSON = "/home/user/app/gallery.json"
|
|
| 19 |
# 갤러리 디렉토리 생성
|
| 20 |
os.makedirs(GALLERY_DIR, exist_ok=True)
|
| 21 |
|
|
|
|
| 22 |
def save_to_gallery(image_path, prompt):
|
|
|
|
|
|
|
| 23 |
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
| 24 |
new_image_path = os.path.join(GALLERY_DIR, f"{timestamp}.png")
|
| 25 |
|
| 26 |
-
#
|
| 27 |
shutil.copy2(image_path, new_image_path)
|
|
|
|
| 28 |
|
| 29 |
# 갤러리 정보 저장
|
| 30 |
gallery_info = {
|
|
@@ -47,6 +51,10 @@ def save_to_gallery(image_path, prompt):
|
|
| 47 |
return new_image_path
|
| 48 |
|
| 49 |
def load_gallery():
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
if os.path.exists(GALLERY_JSON):
|
| 51 |
with open(GALLERY_JSON, "r") as f:
|
| 52 |
gallery = json.load(f)
|
|
|
|
| 19 |
# 갤러리 디렉토리 생성
|
| 20 |
os.makedirs(GALLERY_DIR, exist_ok=True)
|
| 21 |
|
| 22 |
+
|
| 23 |
def save_to_gallery(image_path, prompt):
|
| 24 |
+
print(f"File permissions: {oct(os.stat(new_image_path).st_mode)[-3:]}") # 로그 추가
|
| 25 |
+
|
| 26 |
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
| 27 |
new_image_path = os.path.join(GALLERY_DIR, f"{timestamp}.png")
|
| 28 |
|
| 29 |
+
print(f"Saving image to: {new_image_path}") # 로그 추가
|
| 30 |
shutil.copy2(image_path, new_image_path)
|
| 31 |
+
|
| 32 |
|
| 33 |
# 갤러리 정보 저장
|
| 34 |
gallery_info = {
|
|
|
|
| 51 |
return new_image_path
|
| 52 |
|
| 53 |
def load_gallery():
|
| 54 |
+
if os.path.exists(GALLERY_JSON):
|
| 55 |
+
print(f"Gallery JSON permissions: {oct(os.stat(GALLERY_JSON).st_mode)[-3:]}") # 로그 추가
|
| 56 |
+
|
| 57 |
+
print(f"Loading gallery from: {GALLERY_JSON}") # 로그 추가
|
| 58 |
if os.path.exists(GALLERY_JSON):
|
| 59 |
with open(GALLERY_JSON, "r") as f:
|
| 60 |
gallery = json.load(f)
|