Skip to content

[QTI] Resized images in legacy exercise questions publish without GIF animation or photo orientation #6213

Description

@rtibblesbot

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Target branch: unstable

Observed behavior

When a legacy exercise question has a sized image (![alt](… =WxH)), publishing ships the re-encoded copy from resize_image. The rich text editor writes a size for every image it loads, so this also happens to images the author never resized. Both the Perseus zip and the QTI package show it:

  • An animated GIF (3 frames, 120x90) publishes as a single-frame GIF.
  • A JPEG with EXIF orientation 6 (stored 400x300, displayed 300x400) publishes as its 400x300 pixels stretched to 300x400, with the EXIF removed. It shows sideways and squashed.

Errors and logs

None. resize_image succeeds and logs nothing.

Expected behavior

A sized image publishes at its authored size, with GIF animation and photo orientation kept.

User-facing consequences

Learners see a still frame where the author used an animation. Phone photos, such as a picture of a worksheet, appear rotated and distorted.

Steps to reproduce

  1. On unstable (1beec6e), add a legacy single-choice question and insert an animated GIF and a portrait phone photo with EXIF orientation 6.
  2. Publish the channel.
  3. Open the exercise's Perseus zip (images/) or QTI package (items/images/). The GIF has 1 frame, and the JPEG has no EXIF orientation, with its landscape pixels stretched to the portrait size.

Acceptance Criteria

  • A sized animated GIF in a legacy question publishes with all its frames in the Perseus zip and the QTI package.
  • A sized JPEG with EXIF orientation displays upright and undistorted at its authored size in both archives.
  • Publish tests cover both cases.

AI usage

Claude Code found this while reviewing the #6189 branch. It reproduced the bug on unstable by publishing generated test images, and drafted this issue.

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions