Skip to content

docs: ADR for thumbnails on File components [FC-0138] - #837

Draft
ChrisChV wants to merge 7 commits into
openedx:mainfrom
open-craft:chris/fal-4384-thumbnails-adr
Draft

ChrisChV wants to merge 7 commits into
openedx:mainfrom
open-craft:chris/fal-4384-thumbnails-adr

Conversation

@ChrisChV

@ChrisChV ChrisChV commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Builds on #822

AI disclosure: I used Sonnet 5 to help with research.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Sep 26, 2026
@openedx-webhooks

openedx-webhooks commented Sep 26, 2026 •

Copy link
Copy Markdown

Thanks for the pull request, @ChrisChV!

This repository is currently maintained by @axim-engineering.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

🔘 Update the status of your PR

Your PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate.


Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Sep 26, 2026
@ChrisChV ChrisChV changed the title docs: ADR for thumbnails on File components docs: ADR for thumbnails on File components [FC-0138] Sep 26, 2026
Comment thread docs/openedx_content/decisions/0015-thumbnails-for-file-components.rst Outdated
Comment thread docs/openedx_content/decisions/0015-thumbnails-for-file-components.rst Outdated
Comment thread docs/openedx_content/decisions/0015-thumbnails-for-file-components.rst Outdated
Comment thread docs/openedx_content/decisions/0015-thumbnails-for-file-components.rst Outdated
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Sep 29, 2026
2. Thumbnail metadata lives platform-side, not in ``openedx_content``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A new Django model, ``ImageMediaThumbnail``, owned by openedx-platform, is keyed to the **source image**, not to the File component — via a ``ForeignKey`` referencing the source image's ``ImageMedia`` entry (:ref:`openedx-content-adr-0013`), and records which :class:`Media` object is the current thumbnail for that source image, together with any other presentation-adjacent fields the platform needs for that asset. Consistent with Decision 1, this model is a plain, mutable Django row: creating a new thumbnail or changing these fields is a simple update, not a new version.

@ormsbee ormsbee Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ImageMedia doesn't actually exist. I think I just wrote that as an illustrative example of something I'd like to have down the road.

Also, if it is keyed to ImageMedia, which would be keyed to the immutable Media, why would ImageMediaThumbnail be mutable?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also mentioned ImageMedia in #822 and I do think we should build it if we're building thumbnails.


Creating or regenerating a thumbnail never creates a new version of the File component. The source image continues to be versioned normally, like any other File component content, but the thumbnail itself is not authored content and does not participate in that versioning.

2. Thumbnail metadata lives platform-side, not in ``openedx_content``

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me why this should be platform-owned, as opposed to owned by core.

An independent storage model with no relationship to ``Media``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A platform-side model with its own image field and storage backend, entirely disconnected from ``openedx_content`` — the pattern ``edxval.VideoImage`` already uses for video thumbnails — was considered. It is a simpler design, but it forfeits the content-addressed deduplication that :class:`Media` already provides, and it does not follow the extension pattern that :class:`Media` explicitly documents for third-party apps.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deduplication should be fairly straightforward to do with a disconnected system if we preserved Media's content-based file naming convention, and just appended whatever the resize params were. So the thumbnail file storage could be something like, "{file_namespace}/{original-media-hash}-{thumbnail-params}.webp"

We could even be more aggressive about it and dedupe thumbnails across the whole site, rather than worrying about file storage namespaces.

@ormsbee

ormsbee commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Another thought for your consideration: We could make an image resizing system that sits completely outside the LearningPackage infrastructure, supports lazy generation, but is also invoked during import/upload. Dedupe can still happen, since we know the source Media file names, and can make a convention of re-using that. Plus we can potentially get much more flexibility, if we ever want to let people tweak the resize parameters. We can even encode the resize parameters into the filename. So if the file exists, we send it back, and if not, we generate it.

Image resizing comes up in the context of thumbnails, but it also comes up in a number of other places in courseware, like taking absurdly oversized course card images or HTMLBlock images and resizing them down to something much smaller to send over the wire.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U

Projects

Status: Waiting on Author

Development

Successfully merging this pull request may close these issues.

5 participants