Quote:
Originally Posted by tkeo
Hi Kevin,
The posted patch fixes the bug that cover image is not renamed when cover_offset = 0 due to bool(0) == False.
This happens with the mobi file krzyzacy-tom-pierwszy.mobi, posted:
https://www.mobileread.com/forums/sho...&postcount=693
EDIT: Attached CODE is removed because I have mistaken something in it.
Please try this:
Thanks,
|
Thanks for catching that. I did not think the cover offset could ever be 0 but I guess it could be if there is no thumbnail and no other images.
In an effort to help track down other mistakes like that, I have changed the entire code base to use the python.org PEP recommendation when testing against None as follows:
I have changed all:
== None
to:
is None
And changed all:
!= None
to:
is not None
Now any testing against 0 vs non-zero using "if variable" will stand out as different and I can track down any such occurrences to make sure they were not using it to test against None but were instead looking at the non-zero case.
I have attached a patch to move us to follow the python PEP recommendation.
See pep_use_patch.txt
Nicely done!
KevinH