Quote:
how is calibre going to validate the cover image for all the users?
|
Ensuring it is not
broken is just enough. Sometimes downloads are incomplete due to various reasons, and the image files get broken and unable to load. Checking if an image is not broken doesn't seem to be that complicated (
see).
Quote:
perhaps you could generate a simple flow diagram of how you would program the image insertion code to be able to distinguish a "good" cover from a "bad" cover.
|
When the user explicitly specifies an image, it is not necessary to check whether the cover is the real one or not because the user already knows it is the legitimate one. The reason the user wants to specify it in the first place is because Calibre occasionally assigns the wrong cover or fails to set a cover.
When downloading the specified image fails, do the normal cover finding task like it does when the
--cover option is not set.
Quote:
In simple words, what you are asking for is not a simple task.
|
Then it must be so for the end users. Then why do you ask them to write code for such a complicated task? Most end users are even unfamiliar with coding.
Quote:
For your original query, with the current state of calibre development, how would you know that the URL you want to use to download the image has a valid, reasonably sized image if you haven't visited the page and examined the image for yourself?
|
1. Check the response header like shown in this
post.
2. Download the image.
3. Check if it is not broken.
4-a. Add it to Calibre with the book.
4-b. If it is broken or the given URL is not available, do the normal adding book task without the --cover option.