Skip to content

Commit 0fa3a2b

Browse files
committed
fix: Texture2DConverter - undue swizzle
1 parent 9defdd7 commit 0fa3a2b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

UnityPy/export/Texture2DConverter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def parse_image_data(
316316

317317
original_width, original_height = width, height
318318
switch_swizzle = None
319-
if platform == BuildTarget.Switch and platform_blob is not None:
319+
if platform == BuildTarget.Switch and platform_blob:
320320
gobs_per_block = TextureSwizzler.get_switch_gobs_per_block(platform_blob)
321321
s_tex_format = texture_format
322322
pil_mode = "RGBA"
@@ -362,6 +362,7 @@ def parse_image_data(
362362
img.tobytes("raw", pil_mode), width, height, *block_size, gobs_per_block
363363
)
364364
)
365+
img.mode = pil_mode
365366
img = Image.frombytes(img.mode, (width, height), swizzle_data, "raw", pil_mode)
366367

367368
if original_width != width or original_height != height:

0 commit comments

Comments
 (0)