Resize QTI images at publish to their authored size - #6219
Draft
rtibblesbot wants to merge 2 commits into
Draft
rtibblesbot wants to merge 2 commits into
rtibblesbot wants to merge 2 commits into
Conversation
- Animated GIFs resize every frame, keeping timing and loop; originals ship at natural size or over MAX_ANIMATED_IMAGE_PIXELS. - EXIF-rotated photos come out upright; JPEGs keep their ICC profile. - Same-size re-encodes ship only when smaller than the original. - Sized SVGs get root width/height (and a viewBox when missing). - A failed resize ships the original instead of a dangling reference. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Sized <img> (integer width and height) ship a resized copy per size in the QTI package; width/height stay in the XML. - Rewrites go per element, so one image at two sizes ships two files. - Derived Perseus markdown carries ` =WxH`, so publish resizes and fills the images map. - Legacy items keep the size on their QTI <img>. Refs learningequality#6189 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
rtibblesbot
force-pushed
the
issue-6189-ddc7c9
branch
from
September 30, 2026 16:07
c66e4ed to
65455bc
Compare
Contributor
Author
|
Outside this PR's scope — tracked under #5998:
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly How was this generated?
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Images resized in the QTI editor published at full size: the QTI package shipped the original file, and the derived Perseus archive dropped the size entirely. Each sized
<img>now ships a resized copy per size in both archives, withwidth/heightkept in the QTI XML and=WxHplus a filledimagesmap in the Perseus markdown. The shared resize path also now keeps GIF animation, EXIF orientation and JPEG colour profiles, and ships the original when a resize fails.References
Refs #6189. Refs #6213. Refs #6215 (overlaps #6216). Kolibri display: learningequality/kolibri#15383.
Reviewer guidance
Python tests pass on CI.
Legacy publish output changes:
width/height(and aviewBoxwhen missing).MAX_ANIMATED_IMAGE_PIXELSship the original.<img>in the QTI package now carrieswidth/height.Open risk:
<img>tags are rewritten; a foreign package using a namespace prefix ships full-size files.AI usage
Used Claude Code to plan and implement the publish-time resize and its tests. Verified with the
tests/utils/suite and pre-commit.🤖 Generated with Claude Code
Closes #6189
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
🟢 Reviewing PR
Last updated: 2026-09-30 18:38 UTC