当我使用PythonMagick传输存储在mongoDB(块和文件)中的二进制数据时,我遇到了问题 这是我的代码:
Doc_Images = GridFS(db, "Doc_Images")
filex = Doc_Images.get(r0['_id'])
fobj2 = StringIO.StringIO(self.openDoc(r0['_id'],0))
im = PythonMagick.Image(PythonMagick.Blob(fobj2.getvalue()))
blob = PythonMagick.Blob()
im.write(blob, "jpeg")
fobj=StringIO.StringIO(blob.data)
fobj.seek(0, os.SEEK_END)
并且此行中出现错误:
im = PythonMagick.Image(PythonMagick.Blob(fobj2.getvalue()))
这是错误:
im = PythonMagick.Image(PythonMagick.Blob(fobj2.getvalue()))
RuntimeError: Magick: Read error on strip 876; got 0 bytes, expected 3825. `TIFFFillStrip' @ error/tiff.c/TIFFErrors/515
请解决这个问题吗?