kcc
kcc copied to clipboard
Work-around to "RuntimeError... 'float' object cannot be interpreted as an integer during execution" for kcc-c2e.py powershell/CLI
Hope this is helpful, but I tried implementing the program running kcc-c2e.py for a directory/cbz archive file with powershell on windows. During execution, I kept coming across:
Processing images...
Traceback (most recent call last):
File "<Directory>\kcc\kcc-c2e.py", line 32, in
For kcc\kindlecomicconverter\image.py, on line 258, this was changed from: 255 * (a / 255.) ** gamma to: int(255 * (a / 255.) ** gamma)
So the line became: self.image = ImageOps.autocontrast(Image.eval(self.image, lambda a: int(255 * (a / 255.) ** gamma)))
This resolved the issue and allowed the program to run. :)
Just tried this fix but all my pages are black? Does this occur for you too?
Just tried this fix but all my pages are black? Does this occur for you too?
Hmm.. It seems alright for me when I open up converted files with Calibre e-book reader. It might have to do with how non-kindle programs display the black-white pages? Maybe you could ask the repo owner. :)
I am having the same issue with Python 3.10. The last working version seems to be 3.9.9.
Maybe a pull request with the solution provided here can fix this issue? I don't know if there are better solutions though.
line 258 kcc/kindlecomicconverter/image.py
self.image = ImageOps.autocontrast(Image.eval(self.image, lambda a: int(255 * (a / 255.) ** gamma)))
A new minor release would be great too so it can be used via pip install on other projects. Currently a downgrade may be acceptable, but in the future may be a blocker to use some Python language features in version 3.10 and beyond.
I am having the same issue with Python 3.10. The last working version seems to be 3.9.9.
Maybe a pull request with the solution provided here can fix this issue? I don't know if there are better solutions though.
line 258 kcc/kindlecomicconverter/image.py
self.image = ImageOps.autocontrast(Image.eval(self.image, lambda a: int(255 * (a / 255.) ** gamma)))
A new minor release would be great too so it can be used via pip install on other projects. Currently a downgrade may be acceptable, but in the future may be a blocker to use some Python language features in version 3.10 and beyond.
Thanks for it! At least the "path" is working for me.
@aaronshiu The fix works with pillow 8.4.0, not with 8.3.2 (which is installed as an rpm on Fedora 35).
- fixed in #457