Skip to content

Conversation

@jnovinger
Copy link
Member

@jnovinger jnovinger commented Sep 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.

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
@jnovinger jnovinger requested review from a team and arthanson and removed request for a team September 15, 2025 19:58
@arthanson arthanson merged commit 5bfbca9 into main Sep 15, 2025
10 checks passed
@jeremystretch jeremystretch deleted the 20298-placeholder-image branch September 16, 2025 12:05
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add placeholder image thumbnail if image loading error

3 participants