Skip to content

Fix disappearing cover images when the file is missing from S3 - #623

Merged
bpepple merged 1 commit into
masterfrom
thumbnail-error
Sep 12, 2026
Merged

bpepple merged 1 commit into
masterfrom
thumbnail-error

Conversation

@bpepple

@bpepple bpepple commented Sep 12, 2026

Copy link
Copy Markdown
Member

Summary

  • sorl-thumbnail's get_thumbnail() returns a sizeless placeholder object (not None) when the source file is missing from S3, so {{ im.width }} raised TypeError: 'NoneType' object is not subscriptable. sorl already recovers from that by rendering the {% thumbnail %} tag's {% empty %} clause, but none of our templates defined one — so the cover silently vanished instead of showing the existing "image not found" placeholder, and the log filled with stacked tracebacks per occurrence.
  • Added {% empty %} clauses (reusing each template's existing fallback markup) to every {% thumbnail %} block across comicsdb, reading_lists, user_collection, and users templates.

When an image field references a file missing from S3, sorl-thumbnail returns a sizeless placeholder instead of None, causing `im.width` to raise TypeError. sorl already recovers from that by rendering the tag's `{% empty %}` clause, but none of our templates defined one, so covers silently vanished instead of falling back to the existing "image not found" placeholder.
@bpepple bpepple self-assigned this Sep 12, 2026
@bpepple bpepple added the bug Something isn't working label Sep 12, 2026
@bpepple
bpepple merged commit d74eb3a into master Sep 12, 2026
2 checks passed
@bpepple
bpepple deleted the thumbnail-error branch September 12, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant