Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix program to work with new dependency versions #426

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kindlecomicconverter/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def autocontrastImage(self):
if gamma == 1.0:
self.image = ImageOps.autocontrast(self.image)
else:
self.image = ImageOps.autocontrast(Image.eval(self.image, lambda a: 255 * (a / 255.) ** gamma))
self.image = ImageOps.autocontrast(Image.eval(self.image, lambda a: int(255 * (a / 255.) ** gamma)))

def quantizeImage(self):
colors = len(self.palette) // 3
Expand Down
3 changes: 3 additions & 0 deletions kindlecomicconverter/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ def dependencyCheck(level):
except ImportError:
missing.append('psutil 5.0.0+')
try:
from types import ModuleType
from slugify import __version__ as slugifyVersion
if isinstance(slugifyVersion, ModuleType):
slugifyVersion = slugifyVersion.__version__
if StrictVersion('1.2.1') > StrictVersion(slugifyVersion):
missing.append('python-slugify 1.2.1+')
except ImportError:
Expand Down