From c13cb3355ea42ff3ac6fed2872a90d879562ab68 Mon Sep 17 00:00:00 2001 From: Athemis Date: Fri, 1 Feb 2019 12:52:02 +0100 Subject: [PATCH] implement get_image in new camera module --- phytopi/camera/camera.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phytopi/camera/camera.py b/phytopi/camera/camera.py index dc159a4..3c84759 100644 --- a/phytopi/camera/camera.py +++ b/phytopi/camera/camera.py @@ -6,6 +6,7 @@ import subprocess import signal from enum import Enum +from PIL import Image from phytopi import db, models, app class CameraActionError(Exception): @@ -68,4 +69,9 @@ class CameraWorker(object): self.status == CameraStatus.IDLE else: raise CameraActionError('Camera neither idle nor in timelapse mode!') + + def get_frame(self, thumbnail=False): + img = Image.open('/dev/shm/mjpeg/cam.jpg') + return img + \ No newline at end of file