Resize QTI images at publish to their authored size - #6219
Conversation
c66e4ed to
65455bc
Compare
|
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?
|
65455bc to
b99cf06
Compare
d7d0b26 to
138c5e3
Compare
- Animated GIFs resize every frame, keeping timing and loop; at natural size the original ships. - Past MAX_RESIZED_IMAGE_PIXELS the original ships. - 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>
138c5e3 to
74880f0
Compare
rtibbles
left a comment
There was a problem hiding this comment.
General read through looks correct, and the tests cover the cases. Will do a quick manual check before approving - and just one thought for follow up.
| ) | ||
|
|
||
|
|
||
| def img_pixel_size(width, height) -> Optional[Tuple[int, int]]: |
There was a problem hiding this comment.
I don't think we need to handle it now, because the frontend editor doesn't produce it - but would be good to file a follow up issue for srcset handling here.
There was a problem hiding this comment.
Outside this PR's scope — tracked as #6278 under #5998.
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
- Ran pre-flight CI checks (lint, format, tests) and verified all pass
- Rebased onto the target branch and resolved any conflicts
- Reorganized commit history into clean, logical commits
- Audited the diff to ensure only issue-relevant files are changed
- Built PR body from the repository's PR template with evidence blocks
rtibbles
left a comment
There was a problem hiding this comment.
Did some local QA and the image resizing worked in QTI exercises as intended.
Summary
<img>ships a resized copy per size in the QTI package and the derived Perseus archive.width/height; Perseus markdown gets=WxHand a filledimagesmap.References
Refs #6189. Refs #6213. Refs #6215 (overlaps #6216). Kolibri display: learningequality/kolibri#15383.
Reviewer guidance
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.Deviations from the issue spec
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
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
🟡 Waiting for feedback
Last updated: 2026-10-02 17:18 UTC