From 8fbe558f65796b777b15feda1060b7ec5c6844c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Sun, 5 Jan 2014 12:13:38 +0100 Subject: [PATCH] Updated to Pillow 2.3.0 --- README.md | 3 +-- kcc.py | 2 +- kcc/KCC_gui.py | 2 +- kcc/cbxarchive.py | 2 +- kcc/comic2ebook.py | 21 +++++++++++++++++++++ kcc/comic2panel.py | 14 +++++--------- kcc/image.py | 12 ++++-------- 7 files changed, 34 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index ca49c56..c6dcd5c 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,6 @@ You can find the latest released binary at the following links: - **Windows:** [http://kcc.vulturis.eu/Windows/](http://kcc.vulturis.eu/Windows/) - **Linux:** [http://kcc.vulturis.eu/Linux/](http://kcc.vulturis.eu/Linux/) - **OS X (10.8 or later):** [http://kcc.vulturis.eu/OSX/](http://kcc.vulturis.eu/OSX/) -- **OS X (10.7 or earlier):** Soon™ ## INPUT FORMATS **KCC** can understand and convert, at the moment, the following input types: @@ -43,7 +42,7 @@ You can find the latest released binary at the following links: ### For compiling/running from source: - Python 2.7 - Included in MacOS and Linux, follow the [official documentation](http://www.python.org/getit/windows/) to install on Windows. - [PyQt4](http://www.riverbankcomputing.co.uk/software/pyqt/download) - Please refer to official documentation for installing into your system. -- [Pillow](http://pypi.python.org/pypi/Pillow/) 2.2.1+ - For comic optimizations. Please refer to official documentation for installing into your system. +- [Pillow](http://pypi.python.org/pypi/Pillow/) 2.3.0+ - For comic optimizations. Please refer to official documentation for installing into your system. - [Psutil](https://code.google.com/p/psutil/) - Please refer to official documentation for installing into your system. - **To build OS X release you need a modified QT:** [patch](https://github.com/ciromattia/kcc/blob/master/other/QT-4.8.5-QListWidget.patch) diff --git a/kcc.py b/kcc.py index 84a0bcf..b3f0292 100644 --- a/kcc.py +++ b/kcc.py @@ -26,7 +26,7 @@ __docformat__ = 'restructuredtext en' import sys import os try: - #noinspection PyUnresolvedReferences + # noinspection PyUnresolvedReferences from PyQt4 import QtCore, QtGui, QtNetwork except ImportError: print "ERROR: PyQT4 is not installed!" diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py index 504d192..65e6756 100644 --- a/kcc/KCC_gui.py +++ b/kcc/KCC_gui.py @@ -40,7 +40,7 @@ from xml.dom.minidom import parse from HTMLParser import HTMLParser from KCC_rc_web import WebContent try: - #noinspection PyUnresolvedReferences + # noinspection PyUnresolvedReferences from psutil import TOTAL_PHYMEM, Popen except ImportError: print "ERROR: Psutil is not installed!" diff --git a/kcc/cbxarchive.py b/kcc/cbxarchive.py index e054dcf..7d56dfa 100644 --- a/kcc/cbxarchive.py +++ b/kcc/cbxarchive.py @@ -26,7 +26,7 @@ import locale from sys import platform from subprocess import STDOUT, PIPE try: - #noinspection PyUnresolvedReferences + # noinspection PyUnresolvedReferences from psutil import Popen except ImportError: print "ERROR: Psutil is not installed!" diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index c581585..85d4630 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -35,6 +35,27 @@ from optparse import OptionParser, OptionGroup from multiprocessing import Pool, freeze_support from xml.dom.minidom import parse from uuid import uuid4 +try: + # noinspection PyUnresolvedReferences + from PIL import Image + if tuple(map(int, ('2.3.0'.split(".")))) > tuple(map(int, (Image.PILLOW_VERSION.split(".")))): + print "ERROR: Pillow 2.3.0 or newer is required!" + if sys.platform.startswith('linux'): + import Tkinter + import tkMessageBox + importRoot = Tkinter.Tk() + importRoot.withdraw() + tkMessageBox.showerror("KCC - Error", "Pillow 2.3.0 or newer is required!") + exit(1) +except ImportError: + print "ERROR: Pillow is not installed!" + if sys.platform.startswith('linux'): + import Tkinter + import tkMessageBox + importRoot = Tkinter.Tk() + importRoot.withdraw() + tkMessageBox.showerror("KCC - Error", "Pillow 2.3.0 or newer is required!") + exit(1) try: from PyQt4 import QtCore except ImportError: diff --git a/kcc/comic2panel.py b/kcc/comic2panel.py index 466b35e..f84a60a 100644 --- a/kcc/comic2panel.py +++ b/kcc/comic2panel.py @@ -29,29 +29,25 @@ from shutil import rmtree, copytree, move from optparse import OptionParser, OptionGroup from multiprocessing import Pool, freeze_support try: - #noinspection PyUnresolvedReferences + # noinspection PyUnresolvedReferences from PIL import Image, ImageStat - if tuple(map(int, ('2.2.1'.split(".")))) > tuple(map(int, (Image.PILLOW_VERSION.split(".")))): - print "ERROR: Pillow 2.2.1 or newer is required!" + if tuple(map(int, ('2.3.0'.split(".")))) > tuple(map(int, (Image.PILLOW_VERSION.split(".")))): + print "ERROR: Pillow 2.3.0 or newer is required!" if sys.platform.startswith('linux'): - #noinspection PyUnresolvedReferences import Tkinter - #noinspection PyUnresolvedReferences import tkMessageBox importRoot = Tkinter.Tk() importRoot.withdraw() - tkMessageBox.showerror("KCC - Error", "Pillow 2.2.1 or newer is required!") + tkMessageBox.showerror("KCC - Error", "Pillow 2.3.0 or newer is required!") exit(1) except ImportError: print "ERROR: Pillow is not installed!" if sys.platform.startswith('linux'): - #noinspection PyUnresolvedReferences import Tkinter - #noinspection PyUnresolvedReferences import tkMessageBox importRoot = Tkinter.Tk() importRoot.withdraw() - tkMessageBox.showerror("KCC - Error", "Pillow 2.2.1 or newer is required!") + tkMessageBox.showerror("KCC - Error", "Pillow 2.3.0 or newer is required!") exit(1) try: from PyQt4 import QtCore diff --git a/kcc/image.py b/kcc/image.py index 04895e3..ab19bcc 100755 --- a/kcc/image.py +++ b/kcc/image.py @@ -25,27 +25,23 @@ from sys import platform try: # noinspection PyUnresolvedReferences from PIL import Image, ImageOps, ImageStat, ImageChops - if tuple(map(int, ('2.2.1'.split(".")))) > tuple(map(int, (Image.PILLOW_VERSION.split(".")))): - print "ERROR: Pillow 2.2.1 or newer is required!" + if tuple(map(int, ('2.3.0'.split(".")))) > tuple(map(int, (Image.PILLOW_VERSION.split(".")))): + print "ERROR: Pillow 2.3.0 or newer is required!" if platform.startswith('linux'): - #noinspection PyUnresolvedReferences import Tkinter - #noinspection PyUnresolvedReferences import tkMessageBox importRoot = Tkinter.Tk() importRoot.withdraw() - tkMessageBox.showerror("KCC - Error", "Pillow 2.2.1 or newer is required!") + tkMessageBox.showerror("KCC - Error", "Pillow 2.3.0 or newer is required!") exit(1) except ImportError: print "ERROR: Pillow is not installed!" if platform.startswith('linux'): - #noinspection PyUnresolvedReferences import Tkinter - #noinspection PyUnresolvedReferences import tkMessageBox importRoot = Tkinter.Tk() importRoot.withdraw() - tkMessageBox.showerror("KCC - Error", "Pillow 2.2.1 or newer is required!") + tkMessageBox.showerror("KCC - Error", "Pillow 2.3.0 or newer is required!") exit(1)