From bcdaa4a57e9c1fa152f67982c0ca6404d6099b39 Mon Sep 17 00:00:00 2001 From: Matthew Einhorn Date: Tue, 17 Feb 2015 00:30:11 -0500 Subject: [PATCH 1/2] Fix #2822 by opening images as rb. --- kivy/atlas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kivy/atlas.py b/kivy/atlas.py index 81a4017ed..387050b8d 100644 --- a/kivy/atlas.py +++ b/kivy/atlas.py @@ -266,7 +266,7 @@ class Atlas(EventDispatcher): # open all of the images ims = list() for f in filenames: - fp = open(f) + fp = open(f, 'rb') im = Image.open(fp) im.load() fp.close() From 24f6db65b964746321b56bc56f35b79718f2fe46 Mon Sep 17 00:00:00 2001 From: Matthew Einhorn Date: Tue, 17 Feb 2015 00:34:16 -0500 Subject: [PATCH 2/2] Accept glob like patterns even when shell not available. --- kivy/atlas.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kivy/atlas.py b/kivy/atlas.py index 387050b8d..362f4c82a 100644 --- a/kivy/atlas.py +++ b/kivy/atlas.py @@ -393,6 +393,7 @@ if __name__ == '__main__': to make a new atlas. """ import sys + from glob import glob argv = sys.argv[1:] # earlier import of kivy has already called getopt to remove kivy system # arguments from this line. That is all arguments up to the first '--' @@ -426,7 +427,7 @@ if __name__ == '__main__': print('Error: size must be an integer or x') sys.exit(1) - filenames = argv[2:] + filenames = [fname for fnames in argv[2:] for fname in glob(fnames)] ret = Atlas.create(outname, filenames, size, **options) if not ret: print('Error while creating atlas!')