Skip to content

Commit 200c8cd

Browse files
refactor(texture): texture loading accelerated even more
1 parent ebbf1b9 commit 200c8cd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

xcoder/images.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def load_image_from_buffer(pixel_type: int, width: int, height: int) -> Image.Im
2424
with open("pixel_buffer", "rb") as pixel_buffer:
2525
pixel_buffer.read(1)
2626

27-
return Image.frombytes(
27+
return Image.frombuffer(
2828
get_format_by_pixel_type(pixel_type), (width, height), pixel_buffer.read()
2929
)
3030

@@ -51,7 +51,6 @@ def join_image(pixel_type: int, width: int, height: int) -> Image.Image:
5151
mode,
5252
(chunk_width, chunk_height),
5353
pixel_buffer.read(channel_count * chunk_width * chunk_height),
54-
"raw",
5554
)
5655

5756
image.paste(sub_image, (chunk_x * CHUNK_SIZE, chunk_y * CHUNK_SIZE))

0 commit comments

Comments
 (0)