Skip to content

Commit

Permalink
Stfu Pillow.
Browse files Browse the repository at this point in the history
  • Loading branch information
VocalFan committed May 26, 2024
1 parent 9fa502a commit ac53ca7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions psychtobase/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def convert(psych_mod_folder, result_folder, options):
destination = f'{result_folder}/{modFoldername}{bgCharacterAssets}{filename}'
fileCopy(character, destination)
# Woah, freeplay icons
logging.getLogger('PIL').setLevel(logging.INFO)
with Image.open(character) as img:
# Get the winning/normal half of icons
normal_half = img.crop((0, 0, 150, 150))
Expand All @@ -234,6 +235,7 @@ def convert(psych_mod_folder, result_folder, options):
pixel_name = filename[5:-4] + 'pixel' + filename[-4:]
freeplay_destination = f'{result_folder}/{modFoldername}{freeplayDir}/{pixel_name}'
pixel_img.save(freeplay_destination)
logging.info(f'Saving converted freeplay icon to {freeplay_destination}')
except Exception as e:
logging.error(f'Could not copy asset {character}: {e}')
else:
Expand Down

0 comments on commit ac53ca7

Please sign in to comment.