New binary, changed name
This commit is contained in:
parent
1cc31ca554
commit
f1ef93798e
6
app.py
6
app.py
@ -516,17 +516,17 @@ def index():
|
|||||||
buf.seek(0)
|
buf.seek(0)
|
||||||
import base64
|
import base64
|
||||||
img_data = base64.b64encode(buf.getvalue()).decode()
|
img_data = base64.b64encode(buf.getvalue()).decode()
|
||||||
# If print button pressed, send to catprinter-ble
|
# If print button pressed, send to driver
|
||||||
if "print" in request.form:
|
if "print" in request.form:
|
||||||
try:
|
try:
|
||||||
with tempfile.NamedTemporaryFile(suffix=".png", delete=True) as tmpfile:
|
with tempfile.NamedTemporaryFile(suffix=".png", delete=True) as tmpfile:
|
||||||
image.save(tmpfile, format="PNG")
|
image.save(tmpfile, format="PNG")
|
||||||
tmpfile.flush()
|
tmpfile.flush()
|
||||||
# Run the catprinter-ble command
|
# Run the bleh command
|
||||||
# You can set dither method here if desired
|
# You can set dither method here if desired
|
||||||
result = subprocess.run([
|
result = subprocess.run([
|
||||||
"sudo",
|
"sudo",
|
||||||
"./catprinter-ble",
|
"./bleh",
|
||||||
"-mode", "1bpp",
|
"-mode", "1bpp",
|
||||||
"-intensity", "100",
|
"-intensity", "100",
|
||||||
tmpfile.name
|
tmpfile.name
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user