janeczku / calibre-web

:books: Web app for browsing, reading and downloading eBooks stored in a Calibre database
GNU General Public License v3.0
12.57k stars 1.32k forks source link

No Book-Cover with Kindlegen sending the Book via E-Mail #411

Closed TheLux83 closed 6 years ago

TheLux83 commented 6 years ago

Hey there, I'm using the calibre-web Docker image from technosoft2000 but I think this is no error with the image. When I'm sending a Book to my kindle via Calibre-Web, everything is going well. It send the book and my kindle downloads the book. No problem with that. But unfortunately, it doesn't download or shows me the book cover. When I transfer the eBook via Calibre directly, it shows me the cover.

Is this a normal behavior? If not, do you need anything else to investigate my problem? As I said, I'm running an Container via Docker. Here are the versions how they are displayed at the about page:

Program library Installed Version
Python 2.7.13 (default, Apr 20 2017, 12:13:37) [GCC 6.3.0]
Kindlegen Amazon kindlegen(Linux) V2.9 build 1028-0897292
ImageMagick ImageMagick 6.9.9-21 Q16 x86_64 2017-11-04 http://www.imagemagick.org
PyPDF2 v1.26.0
Babel v2.5.1
SqlAlchemy v1.1.15
Flask v0.12.2
Flask Login v0.4.0
Flask Principal v0.4.0
Tornado web server v4.5.2
ISO639 Languages v0.4.5
Requests v2.18.4
SQlite v3.20.1
Pysqlite v2.6.0
adocampo commented 6 years ago

Hi, I'm facing the very same issue with the same docker container. If developers doesn't see this behaviour normal, I think it could be the container's fault. Besides this, all the other features seems to work as expected, I just noticed that converted epubs to mobi are almost x4 larger than the epub size and even larger than the same epub converted to mobi through calibre.... but I do not know if this is related to kindlegen.

varunpatro commented 6 years ago

Having the same issue here too. @janeczku can you provide any help here? I can help to submit a patch if you can point me in the right direction.

My guess for this is that its something about the metadata image url, but I'm only speculating here.

Kyosfonica commented 6 years ago

I use that container and do not experience the issue. Which kindle are you using? I have kindle keyboard and kindle app. Keyboard doesn't display covers but the app does after the book is downloaded.

adocampo commented 6 years ago

Kindle Voyage 2016.

Kyosfonica commented 6 years ago

Just received my Kindle Paperwhite.

I was able to reproduce the issue so I will take a look into it.

Kyosfonica commented 6 years ago

I checked the flow and what kindlegen does. Unfortunately this is not an issue of calibre-web. The problem is with kindlegen that is unable to convert the epub cover into kindle mobi compatible. Kindlegen is Amazon.com property, it is free to use but it isn't open source.

I checked kindlegen alone and the same issue appears. The book is correctly converted and readable but you get this error message during conversion: Info(prcgen):I1052: Kindle support cover images but does not support cover HTML. Hence using the cover image specified and suppressing cover HTML in content.

The quickest solution is to use another conversor and add the mobi files to the library, but it adds a layer of complexity to the simple "Send to Kindle" feature that we all love.

Calibre has its own conversor but it is embedded in the code. A command line tool is provided but it is just an interface to use the conversor alone. The full project is required to make it work.

Maybe someone is willing to add support to another conversor?

adocampo commented 6 years ago

In fact, kindlegen does the job, but if not as effective, in terms of the size of the converted file, as calibre's one. If you take a EPUB and convert it to MOBI with both calibre and kindlegen, besides calibre can embed the book's cover, the total size of the MOBI file is far smaller than the file generated with Kindlegen. I'm not a developer myself, so I'm not able to develop another conversion engine, but I wonder if it it would be very difficult to use calibre's converter (named ebook-converter) by installing calibre, perhaps we can use it in conjuntion with calibre-web.

Kyosfonica commented 6 years ago

It won't be difficult to add the option to use one or the other as the code just links the executable with the files before sending the book by email.

I can make the changes myself but I have no free time to do it right now.

If any other is willing to do it first, I can guide him. Otherwise I will take care of the changes once I have some free time.

OzzieIsaacs commented 6 years ago

Thanks a lot for digging into this (unfortunally I don't have a kindle.)

adocampo commented 6 years ago

@Kyosfonica to be fair, I didn't tested by myself ebook-convert from calibre's binaries. I guess that is the tool it uses when converting an ebook, but perhaps it does programmatically and not through this tool. So, please, before you invest time, let me test and make us sure it will work. On the other hand, I was unable to install calibre inside the technosoft2000 docker container, so I need to dig also on this to add it to the container or fork it to include at least ebook-convert (and all its dependencies). I'm pretty busy at the moment, and worst of all, I'm a "paper" reader, so I only read ebook ocassionally (when I just finished one and I'm on my way home in the subway) and the only kindle at my reach is the one from my woman, so please be a bit patient, I'll do the tests and report back here

Kyosfonica commented 6 years ago

Hi @adocampo,

I already tested both conversors. Kindle devices doesn't support html covers on books, although the cover is there for the kindle app (at least on Android) and for Kindle keyboard (that is only displayed on the book settings page, so a bit useless) on next gen kindles with cover support this image is not displayed at all.

On the other hand, calibre converter does the job as expected and the cover is visible on all kindle devices. The drawback of this conversor is that you need the full calibre project. There is a separate executable (ebook-convert) but it is an interface to only use the converter via command line without the need actually open calibre. You cannot take the converter off the project because it is not standalone.

I didn't test yet to run calibre from the docker container though. I do not know if there are dependencies to meet before being able to run the conversor via command line.

Kyosfonica commented 6 years ago

@Technosoft2000 is it possible to run calibre on your calibre-web docker image? I am having problems with "No such file or directory" when trying to execute it.

Could you guide me to have calibre up and running?

Technosoft2000 commented 6 years ago

Hi @Kyosfonica

I've seen that the user @jim3ma created a fork and added there the calibre support on the docker image - look at https://github.com/jim3ma/docker-calibre-web

Did you tried this fork already?

Kyosfonica commented 6 years ago

Hi @Technosoft2000,

Didn't know about that fork. Thanks for the information, I will take a look at it.

adocampo commented 6 years ago

I'd tried to follow the steps of several alpine calibre-web dockers to install calibre but none of them worked for me. Is that another cointainer from jim3ma working?

adocampo commented 6 years ago

Just build the jim3ma docker image and it works and calibre is installed. ebook-converter is working inside the image :) I'm trying to modify helper.py, which seems the piece of code in charge of conversions.

TheLux83 commented 6 years ago

Hey there all,
thanks for looking into my problem. It seems, that I was not the only one ^^
Since a few month now, I switched from my kindle paperwhite to my kindle fire tablet. But now I wanted to switch back and remembered this issue.
So, do I have to install jim3ma's Docker Image now? Or is it integrated in @Technosoft2000 Docker Image as well?

Kyosfonica commented 6 years ago

You should use jim3ma's one

captainepoch commented 6 years ago

If calibre is installed, they provide a command-line tool called ebook-convert. With this tool it is possible to convert from epub to mobi and transfer the file to the kindle. Maybe it is useful instead using the kindlegen tool, which convert the file but is sent as a document, not as a book.

OzzieIsaacs commented 6 years ago

Converting books via calibre's ebook-convert is possible now. I consider this as solved.

adocampo commented 6 years ago

Just to be clear, now when you Send to Kindle an EPUB, it uses the ebook-convert tool instead kindlegen? Or is there some setting to check out?

OzzieIsaacs commented 6 years ago

You have to have calibre installed on your pc. Afterwards you can config calibre-web to use the calibre-converter to convert books (admin-> basic config -> converter)

adocampo commented 6 years ago

Perfect! I'm using the calibreweb docker cointainer with calibre preinstalled, so I only need to fetch the latest version and test it.

Thank you very much!!! :)

adocampo commented 6 years ago

Just hang around to say now, ebook-convert works perfectly and sends the cover to Kindle, besides the size of the MOBI file is quite smaller than the books converted with kindlegen. Good job!! :+1:

bodybybuddha commented 6 years ago

FYI @Technosoft2000's docker image has the ebook-convert feature as well.