diff --git a/kivy/tools/texturecompress.py b/kivy/tools/texturecompress.py index 16840fe0f..99a6176cb 100644 --- a/kivy/tools/texturecompress.py +++ b/kivy/tools/texturecompress.py @@ -204,12 +204,17 @@ class PvrtcTool(Tool): s2 = max(w2, h2) print('PVR need a square image, the texture will be {0}x{0}'.format(s2)) + ext = self.source_fn.rsplit('.', 1)[-1] + tmpfile = '/tmp/ktexturecompress.{}'.format(ext) + image = image.resize((s2, s2)) + image.save(tmpfile) + # 4. invoke texture tool raw_tex_fn = self.tex_fn + '.raw' cmd = [self.texturetool] if self.options.mipmap: cmd += ['-m'] - cmd += ['-e', 'PVRTC', '-o', raw_tex_fn, '-f', 'RAW', self.source_fn] + cmd += ['-e', 'PVRTC', '-o', raw_tex_fn, '-f', 'RAW', tmpfile] try: self.runcmd(cmd) with open(raw_tex_fn, 'rb') as fd: