From 1ba1595d1c92988a7ff48856f1540a736bc9350c Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Thu, 8 May 2014 12:12:44 -0400 Subject: [PATCH] Fixed generate.py bug (thanks wolke). --- utils/multires/generate.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/utils/multires/generate.py b/utils/multires/generate.py index 309c94f..c8ec7fd 100644 --- a/utils/multires/generate.py +++ b/utils/multires/generate.py @@ -1,5 +1,7 @@ #!/usr/bin/env python +# Requires Python 3.2+ + # generate.py - A multires tile set generator for Pannellum # Copyright (c) 2014 Matthew Petroff # @@ -88,10 +90,10 @@ for f in range(0, 6): face = face.resize([size, size], Image.ANTIALIAS) for i in range(0, tiles): for j in range(0, tiles): - left = j * 512 - upper = i * 512 - right = min(j * 512 + 512, size) - lower = min(i * 512 + 512, size) + left = j * args.tileSize + upper = i * args.tileSize + right = min(j * args.tileSize + args.tileSize, size) + lower = min(i * args.tileSize + args.tileSize, size) tile = face.crop([left, upper, right, lower]) tile.load() tile.save(os.path.join(args.output, str(level), faceLetters[f] + str(i) + '_' + str(j) + extension))