Skip to content

Commit

Permalink
fix dds conversions on newer pillow
Browse files Browse the repository at this point in the history
  • Loading branch information
gmjosack committed Sep 21, 2021
1 parent acc4be2 commit f01e804
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modlunky2/assets/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def rgba_to_png(data):
def dds_to_png(data):
"""Takes a .DDS `Image` and returns .png data."""
img = Image.open(io.BytesIO(data))
img.tile[0] = img.tile[0][:-1] + ((img.tile[0][-1][0][::-1], 0, 1),)
# Needed in older versions of Pillow before 8.3.x
# img.tile[0] = img.tile[0][:-1] + ((img.tile[0][-1][0][::-1], 0, 1),)
new_data = io.BytesIO()
img.save(new_data, format="PNG")
return new_data.getvalue()
Expand Down

0 comments on commit f01e804

Please sign in to comment.