From 471d5b50d860895738412c0569254159ae91361c Mon Sep 17 00:00:00 2001 From: Elioty Date: Thu, 28 Sep 2023 01:33:06 +0200 Subject: [PATCH] Update SpriteHelper.py: issue #206 Fixing the flip transpose operation when extracting a packed sprite image from a texture. --- UnityPy/export/SpriteHelper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UnityPy/export/SpriteHelper.py b/UnityPy/export/SpriteHelper.py index ffcbf98e..9602e9a3 100644 --- a/UnityPy/export/SpriteHelper.py +++ b/UnityPy/export/SpriteHelper.py @@ -66,10 +66,10 @@ def get_image_from_sprite(m_Sprite) -> Image.Image: if settings_raw.packed == 1: rotation = settings_raw.packingRotation if rotation == SpritePackingRotation.kSPRFlipHorizontal: - sprite_image = sprite_image.transpose(Image.FLIP_TOP_BOTTOM) + sprite_image = sprite_image.transpose(Image.FLIP_LEFT_RIGHT) # spriteImage = RotateFlip(RotateFlipType.RotateNoneFlipX) elif rotation == SpritePackingRotation.kSPRFlipVertical: - sprite_image = sprite_image.transpose(Image.FLIP_LEFT_RIGHT) + sprite_image = sprite_image.transpose(Image.FLIP_TOP_BOTTOM) # spriteImage.RotateFlip(RotateFlipType.RotateNoneFlipY) elif rotation == SpritePackingRotation.kSPRRotate180: sprite_image = sprite_image.transpose(Image.ROTATE_180)