summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2013-11-18 20:19:18 -0500
committeryenatch <yenatch@gmail.com>2013-11-18 20:19:18 -0500
commit9d01c85d3bac2a6a7b5826dc2139f69731a901ab (patch)
treec2edb77bda4c6959d4b984c27cf6afdc3041049d
parent7fa921eb65d71f8ecf2527838090c69aa6d6ac64 (diff)
gfx: make sure rectangular images are also divisible into 8x8 tiles
-rw-r--r--pokemontools/gfx.py2
1 files changed, 1 insertions, 1 deletions
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):