JimmXinu / FanFicFare

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

[Minor Issue]: Story.py - How is this valid? #928

Closed Jemeni11 closed 1 year ago

Jemeni11 commented 1 year ago

https://github.com/JimmXinu/FanFicFare/blob/83a5c28d71ae787662bb04ed8b9512bc44f4f2be/fanficfare/story.py#L147

Expected type 'Union[Tuple[float, float], Tuple[int, int, int, int], None]', got 'Image' instead

This line is highlighted in my editor and after going through the docs I'm confused. How does it work? You're pasting the image into the background but the second argument is invalid Shouldn't this be

background.paste(img)

Update: Nevermind, there's no error, my editor is wrong Although maybe it should be written as

background.paste(img, (0,0), img)

to avoid any confusion?

JimmXinu commented 1 year ago

That code was last touched 8 years and that was for something else. I probably copied it from somewhere and the method signature has changed since then. The fact paste() has special parameter handling suggests it's for back compatibility.

Given that the parameter doc in Pillow is from 10 years ago, it would probably be safe to make this change if you want to submit a PR and a story URL that uses that code for testing.

OTOH, I don't expect it's going to be a real problem any time soon.