Fixes #20298: Add placeholder for failed image thumbnail generation #1242

Closed
opened 2026-04-05 22:31:51 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @jnovinger on 9/15/2025

Fixes: #20298

When Redis cache lacks disk persistence sorl-thumbnail fails to generate thumbnails, leaving only bare filename text visible. This adds an {% empty %} fallback block to the thumbnail template that displays a placeholder with a broken image icon and user instructions when thumbnail generation fails.

The placeholder maintains the expected 200x200px dimensions and provides:

  • Broken image icon (mdi-image-broken-variant)
  • Error message explaining the issue
  • Clickable link to view the original image
  • High contrast text (text-dark) for readability on light background

This can be tested by changing the permission on the thumbnail cache directory before adding a thumbnail, via chmod 444 netbox/media/cache. Just remember to change the permission back after testing.

*Originally created by @jnovinger on 9/15/2025* ### Fixes: #20298 When Redis cache lacks disk persistence `sorl-thumbnail` fails to generate thumbnails, leaving only bare filename text visible. This adds an `{% empty %}` fallback block to the thumbnail template that displays a placeholder with a broken image icon and user instructions when thumbnail generation fails. The placeholder maintains the expected 200x200px dimensions and provides: - Broken image icon (`mdi-image-broken-variant`) - Error message explaining the issue - Clickable link to view the original image - High contrast text (`text-dark`) for readability on light background This can be tested by changing the permission on the thumbnail cache directory before adding a thumbnail, via `chmod 444 netbox/media/cache`. Just remember to change the permission back after testing.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#1242