From 31b76fba92b7f1701e93b67cd68ab16f0fe569e3 Mon Sep 17 00:00:00 2001 From: "beville@gmail.com" Date: Wed, 10 Apr 2013 20:46:59 +0000 Subject: [PATCH] Make sure out data is set in the case of pages that don't need to be resized git-svn-id: http://comictagger.googlecode.com/svn/trunk@586 6c5673fe-1810-88d6-992b-cd32ca31540c --- scripts/shrink.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/shrink.py b/scripts/shrink.py index 05d3ead..edc7d19 100644 --- a/scripts/shrink.py +++ b/scripts/shrink.py @@ -125,6 +125,7 @@ def main(): for idx in range(ca.getNumberOfPages()): name = ca.getPageName( idx ) in_data = ca.getPage( idx ) + out_data = in_data if in_data is not None: try: im = Image.open(StringIO.StringIO(in_data)) @@ -143,7 +144,7 @@ def main(): except IOError: #doesn't appear to be an image - out_data = in_data + pass else: #page is empty?? nothing to write @@ -152,7 +153,7 @@ def main(): sys.stdout.write('.') sys.stdout.flush() - #Generate a new name for the page file + #write out the new resized image zout.writestr(name, out_data)