convert back to rgb as some hosts add alpha

This commit is contained in:
DepFA 2022-10-10 15:43:09 +01:00 committed by GitHub
parent 707a431100
commit df6d0d9286
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,7 +64,7 @@ def crop_black(img,tol=0):
def extractImageDataFooter(image): def extractImageDataFooter(image):
d=3 d=3
outarr = crop_black(np.array(image.getdata()).reshape(image.size[1],image.size[0],d ).astype(np.uint8) ) outarr = crop_black(np.array(image.convert('RGB').getdata()).reshape(image.size[1],image.size[0],d ).astype(np.uint8) )
lastRow = np.where( np.sum(outarr, axis=(1,2))==0) lastRow = np.where( np.sum(outarr, axis=(1,2))==0)
if lastRow[0].shape[0] == 0: if lastRow[0].shape[0] == 0:
print('Image data block not found.') print('Image data block not found.')