mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-24 00:46:16 +03:00
Do not cast to bytes for set_as_raw()
This commit is contained in:
parent
f69168523e
commit
badc92079d
|
@ -341,7 +341,7 @@ class BLP1Decoder(_BLPBaseDecoder):
|
|||
if self._blp_encoding in (4, 5):
|
||||
palette = self._read_palette()
|
||||
data = self._read_bgra(palette)
|
||||
self.set_as_raw(bytes(data))
|
||||
self.set_as_raw(data)
|
||||
else:
|
||||
msg = f"Unsupported BLP encoding {repr(self._blp_encoding)}"
|
||||
raise BLPFormatError(msg)
|
||||
|
@ -412,7 +412,7 @@ class BLP2Decoder(_BLPBaseDecoder):
|
|||
msg = f"Unknown BLP compression {repr(self._blp_compression)}"
|
||||
raise BLPFormatError(msg)
|
||||
|
||||
self.set_as_raw(bytes(data))
|
||||
self.set_as_raw(data)
|
||||
|
||||
|
||||
class BLPEncoder(ImageFile.PyEncoder):
|
||||
|
|
|
@ -506,7 +506,7 @@ class DdsRgbDecoder(ImageFile.PyDecoder):
|
|||
data += o8(
|
||||
int(((masked_value >> mask_offsets[i]) / mask_totals[i]) * 255)
|
||||
)
|
||||
self.set_as_raw(bytes(data))
|
||||
self.set_as_raw(data)
|
||||
return -1, 0
|
||||
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ class QoiDecoder(ImageFile.PyDecoder):
|
|||
if bands == 3:
|
||||
value = value[:3]
|
||||
data += value
|
||||
self.set_as_raw(bytes(data))
|
||||
self.set_as_raw(data)
|
||||
return -1, 0
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user