janeczku / calibre-web

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

Cover thumbnails not being generated when books are imported from calibredb #3149

Closed wonx closed 2 months ago

wonx commented 2 months ago

Describe the bug/problem

I usually import books by placing them in a folder and using calibredb to add them to my database. Something like this: /app/calibre/calibredb add --with-library=/books /books_to_import

However, this last time, all the books it imported are missing their cover. The cover.jpg file on each folder is missing.

To Reproduce

Steps to reproduce the behavior:

  1. Access calibre-web from a console
  2. run /app/calibre/calibredb add --with-library=/books /books_to_import
  3. Wait for the process to finish.
  4. Open calibre-web on a web browser. The covers will be missing

Logfile

Example when adding a single epub book:

root@e8a6e307060c:/newbooks# /app/calibre/calibredb add --with-library=/books /newbooks
Failed to import PyQt module: PyQt6.QtGui with error: libEGL.so.1: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "calibre/db/cache.py", line 1635, in set_metadata
  File "calibre/db/cache.py", line 1558, in set_cover
  File "calibre/db/backend.py", line 1611, in set_cover
  File "bypy-importer.py", line 279, in exec_module
  File "calibre/utils/img.py", line 12, in <module>
ImportError: cannot import name 'QColor' from 'qt.core' (/app/calibre/lib/calibre-extensions/python-lib.bypy.frozen/qt/core.pyc)

Added book ids: 71595

root@e8a6e307060c:/newbooks#

Expected behavior

Book covers should have been extracted from the epub files.

Screenshots

imatge

Environment (please complete the following information):

Additional context Add any other context about the problem here. [e.g. access via reverse proxy, database background sync, special database location]

wonx commented 2 months ago

Ok, I was able to fix the issue. For anyone else experiencing the same, there are 3 libraries that are needed. They can be installed with:

apt install libegl1 libxkbcommon-x11-0 libopengl0