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?
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)
array = np.frombuffer(buffer.getvalue())
image = cv2.imdecode(array, cv2.IMREAD_COLOR)
cv2.imshow('QR code', image)
cv2.waitKey(0)
cv2.destroyAllWindows()
sys.exit()
Thanks!
Trying to feed a PNG buffer to
np.frombufferand getting a buffer size error.New to Python... would someone happen to know what is going on and how to fix this?
Thanks!