JimmXinu / FanFicFare

FanFicFare is a tool for making eBooks from stories on fanfiction and other web sites.
Other
750 stars 161 forks source link

Possible bug when using Image.py to download from RR on CLI #848

Closed Twilight666 closed 2 years ago

Twilight666 commented 2 years ago

I am not sure if this is a problem with FFF or Image.py but lately when I download stories from Royal Road I get errors like this:

C:\Python3.7\lib\site-packages\PIL\Image.py:2850: DecompressionBombWarning: Image size (96000000 pixels) exceeds limit of 89478485 pixels, could be decompression bomb DOS attack. DecompressionBombWarning, Downloaded Story: "Sporemageddon (Ch 19-23)" by "RavensDagger", Chapters: 23, Updated on: "2022-06-06"

The story I am downloading is https://www.royalroad.com/fiction/54658/[19-] And both the story and the images seem to have been downloaded successfully I don't know if this is something that can be fixed or if it is an error with a different project that FFF uses In fact I don't know if it even counts as an error since the story is downloaded properly

As far as options on personal.ini the only one that has anything to do with it are:

include_images:true make_firstimage_cover:false

under [epub]

JimmXinu commented 2 years ago

I do see that on image https://i.imgur.com/0hCV2U9.jpeg

That's a warning coming from PIL (as implemented by Pillow). It's nothing to do with FFF itself.

Pillow has a "DecompressionBomb" check that warns when pixels > MAX_IMAGE_PIXELS and errors when pixels > 2 * MAX_IMAGE_PIXELS. MAX_IMAGE_PIXELS = int(1024 * 1024 * 1024 // 4 // 3) = 89478485 as the warning states.

If you do happen to run into an image with more than 178956970 pixels, you can use the FFF setting no_image_processing: true to get around it.