Skip to content

Book covers not displayed — fetch.php returns 200 OK JPEGs but thumbnails remain blank (Synology DSM 7.2 + PHP 8.1) #536

@franciscofontsanchez

Description

@franciscofontsanchez

🧩 Environment

NAS: Synology (DSM 7.2.2)
Web Server: Web Station (Nginx)
PHP: 8.1.31 (via Web Station)
COPS version: latest (master branch from GitHub)
Calibre database path: /volume1/magazines/MAGAZINES Biblioteca/
Browser: Chrome (latest, Windows 11)

🧩 Summary

COPS loads and works correctly (authors, series, books, PDF downloads all OK) but book cover thumbnails are never displayed.
The same behavior occurs on both:

https://xxxxxxxxxx.synology.me/cops/
https://192.168.1.28/cops/

Network tab shows every thumbnail request returning HTTP 200 / image/jpeg, yet Chrome never renders them (blank thumbnails).

🧩 What has been verified

✅ gd_test.php confirms PHP GD can create and output JPEG images.
✅ Static images served from /web/cops/images/static_test.jpg display fine.
✅ fetch.php?height=...&id=...&db=0 downloads a valid JPEG (checked via wget → “JPEG image data”).
✅ Permissions: http user has r-x on the Calibre library and rwx on /web/cops/images.
✅ open_basedir includes:

/volume1/web:/volume1/web/cops:/volume1/web/cops/images:
/volume1/magazines:/volume1/magazines/MAGAZINES Biblioteca:
/tmp:/var/services/tmp

✅ All PHP extensions loaded: gd, pdo_sqlite, sqlite3, json, curl, intl.
✅ checkconfig.php reports OK for everything.
✅ Latest COPS (master) freshly installed.
✅ Same issue under both HTTP and HTTPS.
✅ Tried forcing static covers via $config['cops_images_directory'] = '/volume1/web/cops/images/'; – directory is writable, still blank.
✅ Tried forcing cops_public_url, cops_provide_https, and cops_use_url_rewriting = "0".
✅ Tried patching fetch.php to ensure db=0 (default).
✅ No relevant errors in php_errors.log; every fetch returns 200 OK.

🧩 Expected behavior

COPS should display thumbnails (covers) next to books as usual.

🧩 Actual behavior

All thumbnails appear as broken images, despite HTTP 200 responses.
Opening the same fetch.php?... URL directly in the browser downloads a valid JPEG.
So the server produces correct data, but COPS/Chrome never renders them inside the page.

🧩 Possible clues

The HTML img tag’s src points to fetch.php?...&db= (sometimes empty or 0).
Chrome’s console shows no mixed-content or CORS errors.
Using HTTPS with IP shows cert CN mismatch, but even plain HTTP behaves identically.
Looks like either the template or JS layer suppresses img display after fetch.

🧩 Steps tried (unsuccessful)

Multiple COPS versions (current master and older release).
Clearing caches, forcing reload, changing themes.
Custom CSS injected via $config['cops_html_head_add'] to force img {display:block}.
Rebuilding Calibre metadata.db and covers.
Using PHP 7.4 instead of 8.1.
Running over HTTP vs HTTPS.
Forcing static images in /web/cops/images/.
None made the covers render.

🧩 Request

Could you please confirm:
Is there a known issue with thumbnail rendering on PHP 8 + latest COPS?
Is fetch.php expected to return images correctly when db is empty?
Any recent change in templates or JS that could hide images in modern browsers?
How can we enable additional debug output specifically for cover generation?

Thanks for any guidance—COPS works great otherwise, only thumbnails remain invisible.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions