mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
decode() should return -1 when finished
This commit is contained in:
parent
475b7233d6
commit
87dbc7043b
|
@ -253,7 +253,7 @@ class DXT1Decoder(ImageFile.PyDecoder):
|
||||||
self.set_as_raw(_dxt1(self.fd, self.state.xsize, self.state.ysize))
|
self.set_as_raw(_dxt1(self.fd, self.state.xsize, self.state.ysize))
|
||||||
except struct.error as e:
|
except struct.error as e:
|
||||||
raise OSError("Truncated DDS file") from e
|
raise OSError("Truncated DDS file") from e
|
||||||
return 0, 0
|
return -1, 0
|
||||||
|
|
||||||
|
|
||||||
class DXT5Decoder(ImageFile.PyDecoder):
|
class DXT5Decoder(ImageFile.PyDecoder):
|
||||||
|
@ -264,7 +264,7 @@ class DXT5Decoder(ImageFile.PyDecoder):
|
||||||
self.set_as_raw(_dxt5(self.fd, self.state.xsize, self.state.ysize))
|
self.set_as_raw(_dxt5(self.fd, self.state.xsize, self.state.ysize))
|
||||||
except struct.error as e:
|
except struct.error as e:
|
||||||
raise OSError("Truncated DDS file") from e
|
raise OSError("Truncated DDS file") from e
|
||||||
return 0, 0
|
return -1, 0
|
||||||
|
|
||||||
|
|
||||||
Image.register_decoder("DXT1", DXT1Decoder)
|
Image.register_decoder("DXT1", DXT1Decoder)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user