Compare commits
2 Commits
d2451c935e
...
8da647dff7
| Author | SHA1 | Date | |
|---|---|---|---|
| 8da647dff7 | |||
| 776750fc77 |
7
INSTALL
Normal file
7
INSTALL
Normal file
@ -0,0 +1,7 @@
|
||||
sudo apt update
|
||||
sudo apt install libcap-dev xinit
|
||||
|
||||
python3 -m venv venv
|
||||
. venv/bin/activate
|
||||
pip install pygame qrcode escpos picamera2
|
||||
|
||||
6
main.py
6
main.py
@ -6,6 +6,12 @@ import picamera
|
||||
from Fotobox import Fotobox
|
||||
|
||||
with picamera.PiCamera() as camera:
|
||||
camera.vflip = False
|
||||
camera.hflip = True
|
||||
camera.resolution = (2592, 1944)
|
||||
camera.rotation = 0
|
||||
camera.start_preview()
|
||||
|
||||
fotobox = Fotobox(camera)
|
||||
try:
|
||||
fotobox.run()
|
||||
|
||||
64
picamera.py
64
picamera.py
@ -1,32 +1,32 @@
|
||||
import time
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from config import DEBUG
|
||||
|
||||
|
||||
# noinspection PyMethodMayBeStatic,PyShadowingBuiltins
|
||||
class PiCamera:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def start_preview(self):
|
||||
pass
|
||||
|
||||
def capture(self, output, format):
|
||||
with Image.open("./data/demo.jpg") as img:
|
||||
img.save(output, "JPEG")
|
||||
if not DEBUG:
|
||||
time.sleep(0.5)
|
||||
|
||||
def stop_preview(self):
|
||||
pass
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
self.close()
|
||||
# import time
|
||||
#
|
||||
# from PIL import Image
|
||||
#
|
||||
# from config import DEBUG
|
||||
#
|
||||
#
|
||||
# # noinspection PyMethodMayBeStatic,PyShadowingBuiltins
|
||||
# class PiCamera:
|
||||
# def __init__(self):
|
||||
# pass
|
||||
#
|
||||
# def start_preview(self):
|
||||
# pass
|
||||
#
|
||||
# def capture(self, output, format):
|
||||
# with Image.open("./data/demo.jpg") as img:
|
||||
# img.save(output, "JPEG")
|
||||
# if not DEBUG:
|
||||
# time.sleep(0.5)
|
||||
#
|
||||
# def stop_preview(self):
|
||||
# pass
|
||||
#
|
||||
# def close(self):
|
||||
# pass
|
||||
#
|
||||
# def __enter__(self):
|
||||
# return self
|
||||
#
|
||||
# def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
# self.close()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user