JimmXinu / FanFicFare

FanFicFare is a tool for making eBooks from stories on fanfiction and other web sites.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Failed to load or convert image" using Pillow 10.0.0

KriPet opened this issue · comments

I'm using fanficfare as a cli utility, and when running the following command:

fanficfare -o "include_images=true" https://www.royalroad.com/fiction/58187/player-manager-a-football-management-progression --debug

I get the error

FFF: INFO: 2023-10-07 13:14:35,764: story.py(1629): Failed to load or convert image,
parent:https://www.royalroad.com/fiction/58187/player-manager-a-sports-progression-fantasy/chapter/1365398/31-in-and-out
skipping:https://ted-steel.com/wp-content/uploads/2023/07/PNG-image-216CA4A98572-1.png
Exception: module 'PIL.Image' has no attribute 'ANTIALIAS'

This is due to Pillow removing the ANTIALIAS flag in 10.0.0 (https://pillow.readthedocs.io/en/stable/releasenotes/10.0.0.html#constants)
The new flag with the same functionality is LANCZOS.

Fanficfare uses this in story.py:144

I'm using the following versions:
Python: 3.11.2
Pillow: 10.0.1
FanFicFare: 4.28.0

Thanks for the detailed problem report. Test version is posted to test.pypi.org

LANCZOS was added in Pillow 2.7.0, in early 2015. FFF first started using Pillow in 2016, so I've set minimum Pillow version in pyproject.toml to the contemporaneous Pillow version(3.3.0).

pip install --extra-index-url https://testpypi.python.org/pypi --upgrade FanFicFare[image_processing]