Fix snapshot call (#14448)

This commit is contained in:
Nicolas Mowen 2024-10-19 13:11:49 -06:00 committed by GitHub
parent 3c591ad8a9
commit 2137de37b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1528,11 +1528,11 @@ def label_snapshot(request: Request, camera_name: str, label: str):
) )
try: try:
event = event_query.get() event: Event = event_query.get()
return event_snapshot(request, event.id) return event_snapshot(request, event.id, MediaEventsSnapshotQueryParams())
except DoesNotExist: except DoesNotExist:
frame = np.zeros((720, 1280, 3), np.uint8) frame = np.zeros((720, 1280, 3), np.uint8)
ret, jpg = cv2.imencode(".jpg", frame, [int(cv2.IMWRITE_JPEG_QUALITY), 70]) _, jpg = cv2.imencode(".jpg", frame, [int(cv2.IMWRITE_JPEG_QUALITY), 70])
return Response( return Response(
jpg.tobytes, jpg.tobytes,