Skip to content

Commit 1ea6cbf

Browse files
committed
Review changes
1 parent 7d72fae commit 1ea6cbf

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

examples/verdure/client/ios/Runner/Info.plist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
<key>UIMainStoryboardFile</key>
3030
<string>Main</string>
3131
<key>UISupportedInterfaceOrientations</key>
32+
<key>NSAppTransportSecurity</key>
33+
<dict>
34+
<key>NSAllowsLocalNetworking</key>
35+
<true/>
36+
</dict>
3237
<array>
3338
<string>UIInterfaceOrientationPortrait</string>
3439
<string>UIInterfaceOrientationLandscapeLeft</string>

examples/verdure/server/verdure/agent_executor.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,14 @@ async def execute(
102102
logger.info(f" Extracting {len(part.root.file.bytes)} bytes")
103103
try:
104104
image_bytes = base64.b64decode(file_data.bytes)
105-
filename = f"{uuid.uuid4()}.jpg" # Default to jpg, or try to detect
105+
mime_type = file_data.mime_type
106+
extension = {
107+
"image/png": ".png",
108+
"image/jpeg": ".jpg",
109+
"image/heic": ".heic",
110+
"image/webp": ".webp",
111+
}.get(mime_type, ".jpg")
112+
filename = f"{uuid.uuid4()}{extension}"
106113
images_dir = os.path.join(os.path.dirname(__file__), "images", "uploads")
107114
os.makedirs(images_dir, exist_ok=True)
108115
filepath = os.path.join(images_dir, filename)

0 commit comments

Comments
 (0)