Skip to content

Remove unused easy-thumbnails and Pillow from the backend #2883

Closed

Description

@lunika

Context

Pillow keeps raising security alerts on the backend (it was just upgraded to 13.0.0). Our dependencies only pull it in through easy-thumbnails, and the backend no longer uses easy-thumbnails at all. Pillow's only other use is a template tag that nothing calls. If we remove both, Pillow goes away and so do its alerts.

Dead code to remove

easy-thumbnails

  • src/backend/pyproject.toml: easy_thumbnails==2.10.1 (then regenerate uv.lock; Pillow should drop out, check with uv tree --invert --package pillow)
  • src/backend/impress/settings.py: "easy_thumbnails" in INSTALLED_APPS and the THUMBNAIL_* settings (THUMBNAIL_ALIASES is empty)
  • There is no get_thumbnailer, ThumbnailerImageField, {% thumbnail %} or ImageField anywhere in the backend.

extra_tags template tags (the only direct Pillow import)

  • src/backend/core/templatetags/extra_tags.py: the base64_static tag and image_to_base64 use PIL.ImageFile.Parser, but no template or MJML source uses base64_static.
  • {% load ... extra_tags %} in the mail templates (core/templates/mail/html/template.html, core/templates/mail/text/template.txt) and in their MJML sources in src/mail, so they don't come back on the next make mails-build. If the import of PIL stays while Pillow is removed, this load would break mail rendering.

Database

  • The easy_thumbnails_source, easy_thumbnails_thumbnail (and easy_thumbnails_thumbnaildimensions) tables stay in existing databases once the app is removed. Decide whether to drop them with a migration in core or leave them.
  • src/backend/core/management/commands/anonymize_database.py lists easy_thumbnails_source and easy_thumbnails_thumbnail: remove them, or make sure the command handles missing tables.

Done when

  • Neither easy-thumbnails nor pillow is in src/backend/uv.lock
  • Mails still render (HTML and text)
  • make lint and the backend tests pass

Activity

  1. added
    dependencies
    python
    on Oct 21, 2026
  2. RoeeSivan commented on Oct 24, 2026

    @RoeeSivan
    Contributor

    Hi @lunika, I'd like to take this one. I checked the current main and found a few things to handle besides removing the dependency:

    • Pillow isn't a direct dependency (it comes in through easy_thumbnails), but core/templatetags/extra_tags.py imports PIL for the base64_static tag. No template uses that tag. mail/mjml/template.mjml only does {% load extra_tags %}. I'd remove the tag (and the module if it ends up empty) along with that load.
    • core/management/commands/anonymize_database.py truncates easy_thumbnails_source and easy_thumbnails_thumbnail. Once the app is removed, those tables won't exist on new installs and the command would fail, so I'd remove them from TRUNCATES.
    • The rest is removing easy_thumbnails from INSTALLED_APPS, the THUMBNAIL_* settings and pyproject.toml. No migration depends on it.

    One question: on existing instances, the two easy_thumbnails_* tables will stay in the database. Should I add a migration that drops them, or leave them?

    Can you assign it to me?

  3. lunika commented on Oct 25, 2026

    @lunika
    MemberAuthor

    I would let them, add an entry in the upgrade guide to inform users and let them decide if they wan to keep these tables or not.

  4. added a commit that references this issue on Oct 27, 2026
    95c9287
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

backenddependenciespythonrefacto

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions