Open sunknudsen opened 3 years ago
Found a fix... does the following code look good to you?
from cv2 import cv2
import pyqrcode
import io
import numpy as np
import sys
buffer = io.BytesIO()
qr = pyqrcode.create("foo")
qr.png(buffer, scale=2)
buffer.seek(0)
array = np.asarray(bytearray(buffer.read()), dtype=np.uint8)
image = cv2.imdecode(array, cv2.IMREAD_COLOR)
cv2.imshow('QR code', image)
cv2.waitKey(0)
cv2.destroyAllWindows()
sys.exit()
thank you so much! It actually worked!
Trying to feed a PNG buffer to
np.frombuffer
and getting a buffer size error.New to Python... would someone happen to know what is going on and how to fix this?
Thanks!