我正在使用以下代码来查找给定图像的位深度:
def parseImage(self):
with open(self.imageAddress, "rb") as image:
data = bytearray(image.read())
bitDepth = struct.unpack_from("<L", data, 0x0000001c)
print("the image's colour depth is " + str(bitDepth[0]))
当我输入我的其他测试图像时,它应该可以正常工作,但是当我专门从这个页面输入小样本图像时,它会输出 196640。我在 Hex Editor Neo 中查看了该文件,所选字节的值为 32 . 有谁知道为什么程序不返回这个值?