We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d12d99 commit e2e6bd2Copy full SHA for e2e6bd2
server/server.py
@@ -271,15 +271,8 @@ def get(self):
271
image_url = f"/image/{image_id}"
272
return {"screenshot_url": image_url}, 200
273
else:
274
- # Display the image directly (GET method will delete after serving)
275
- response = send_file(screenshot_path, mimetype="image/png")
276
- # Delete the file after serving
277
- try:
278
- os.remove(screenshot_path)
279
- logger.info(f"Deleted screenshot: {screenshot_path}")
280
- except Exception as e:
281
- logger.error(f"Failed to delete screenshot {screenshot_path}: {e}")
282
- return response, 200
+ # Return ImageResource
+ return ImageResource.get(image_id)
283
284
except Exception as e:
285
logger.error(f"Error getting screenshot: {e}")
0 commit comments