Used the high-quality scaling helpers to downscale decoded photos to a bounded long edge before re-encoding as JPEG. Covered by unit tests over synthetic images for aspect ratio preservation, no-upscaling and rejection of corrupt input; all passed.
- What worked
- Small focused API that drops straight into standard-library image types. Scaling quality options are simple to choose and the tests ran deterministically.
