nikhil1raghav / kindle-send

Send webpages, documents and bookmarks to kindle
GNU Affero General Public License v3.0
199 stars 23 forks source link

Inconsistent handling of missing images #31

Open volkerwestphal opened 1 year ago

volkerwestphal commented 1 year ago

Describe the bug When a website contains an embedded image, but the image resource is unavailable, kindle-send handles the situation differently on Linux and Windows.

On Linux. the message is reasonable. After raising this message, kindle-send creates a non-empty epub file.

Couldn't add image <imageurl> : Error retrieving <imageurl> from source: Error retrieving

On Windows, the message seems off. kindle-send skipps not just the image, put the pages that includes the missing resource.

SKIPPING <pageurl> : Error retrieving <imageurl> from source:
 open <imageurl>: Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch.
 cannot get file, bad return code
 missing data prefix

The german text means "syntax for the file name is invalid"

To Reproduce

On Linux:

./kindle-send download https://volkerwestphal.github.io/kindle-send-tests/blog-invalid-img-png.html
./kindle-send download https://volkerwestphal.github.io/kindle-send-tests/blog-invalid-img-svg.html

On Windows:

kindle-send.exe download https://volkerwestphal.github.io/kindle-send-tests/blog-invalid-img-png.html
kindle-send.exe download https://volkerwestphal.github.io/kindle-send-tests/blog-invalid-img-svg.html

Expected behavior The behaviour of kindle-send on Linux seems right. It skips over non-existing resources and continues the job.

Additional context