Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -65,6 +65,7 @@ def run(url,access_key_id,access_key_secret,securityToken,endpoint,bucket_name,u
|
|
65 |
|
66 |
if downloaded_image:
|
67 |
output_image_path = remove_metadata(downloaded_image,result_image)
|
|
|
68 |
if access_key_id and endpoint and bucket_name:
|
69 |
# 步骤 3:上传到阿里云 OSS
|
70 |
oss_url = upload_to_oss(output_image_path, upload_filename, bucket_name, access_key_id, access_key_secret,securityToken, endpoint)
|
@@ -78,6 +79,7 @@ def run(url,access_key_id,access_key_secret,securityToken,endpoint,bucket_name,u
|
|
78 |
else:
|
79 |
with open(output_image_path,'rb') as f:
|
80 |
image_base64 = base64.b64encode(f.read())
|
|
|
81 |
delete_local_file(output_image_path) # 删除压缩后的图片
|
82 |
return image_base64
|
83 |
else:
|
|
|
65 |
|
66 |
if downloaded_image:
|
67 |
output_image_path = remove_metadata(downloaded_image,result_image)
|
68 |
+
print("元数据移除完成")
|
69 |
if access_key_id and endpoint and bucket_name:
|
70 |
# 步骤 3:上传到阿里云 OSS
|
71 |
oss_url = upload_to_oss(output_image_path, upload_filename, bucket_name, access_key_id, access_key_secret,securityToken, endpoint)
|
|
|
79 |
else:
|
80 |
with open(output_image_path,'rb') as f:
|
81 |
image_base64 = base64.b64encode(f.read())
|
82 |
+
print("运行完成")
|
83 |
delete_local_file(output_image_path) # 删除压缩后的图片
|
84 |
return image_base64
|
85 |
else:
|