From 9d01c85d3bac2a6a7b5826dc2139f69731a901ab Mon Sep 17 00:00:00 2001 From: yenatch Date: Mon, 18 Nov 2013 20:19:18 -0500 Subject: gfx: make sure rectangular images are also divisible into 8x8 tiles --- pokemontools/gfx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pokemontools/gfx.py b/pokemontools/gfx.py index 141f27e..2ea6b54 100644 --- a/pokemontools/gfx.py +++ b/pokemontools/gfx.py @@ -1211,7 +1211,7 @@ def convert_2bpp_to_png(image, width=0, height=0, pal_file=None): matches = [] for w in range(8, num_pixels / 2 + 1, 8): h = num_pixels / w - if w * h == num_pixels: + if w * h == num_pixels and h % 8 == 0: matches += [(w, h)] # go for the most square image if len(matches): -- cgit v1.2.3