Render crop and optimized variants next to the thumbnail

The worker decodes the original once (JPEG draft down to the optimized
box, EXIF orientation applied in place, alpha composed on white) and
encodes three variants: the 256 px thumbnail, a centred 128x128 JPEG crop
that may upscale and a WebP fitted into 1280x1280 without upscaling,
quality 80, method 4. No EXIF, ICC or XMP is written. The byte limit is
checked before decoding. ready is set by the transaction that stores all
three rows, so a partial set is never published.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Artyom
2026-10-29 03:00:11 +03:00
co-authored by Claude Opus 5.5
parent 045d631c12
commit 431b82fd43
9 changed files with 222 additions and 82 deletions
@@ -1,8 +1,8 @@
## 1. Варианты crop и optimized
- [ ] 1.1 `render_variants`: проверка байтов и пикселей по заголовку, draft для JPEG, ориентация без копии, компоновка на белый, `thumbnail`, `crop` 128×128 JPEG, `optimized` WebP в 1280×1280 без метаданных; ошибка `ImageTooDemanding` в домене зоны
- [ ] 1.2 Тесты рендера и pipeline: три варианта у fixture, геометрия crop и optimized (вытянутые, маленькие, EXIF 6, альфа), отсутствие EXIF, `ready` только с полным набором, `404` на вариант вложения лабы 4
- [ ] 1.3 Проверка группы: `make lint`, `make student-test`
- [x] 1.1 `render_variants`: проверка байтов и пикселей по заголовку, draft для JPEG, ориентация без копии, компоновка на белый, `thumbnail`, `crop` 128×128 JPEG, `optimized` WebP в 1280×1280 без метаданных; ошибка `ImageTooDemanding` в домене зоны
- [x] 1.2 Тесты рендера и pipeline: три варианта у fixture, геометрия crop и optimized (вытянутые, маленькие, EXIF 6, альфа), отсутствие EXIF, `ready` только с полным набором, `404` на вариант вложения лабы 4
- [x] 1.3 Проверка группы: `make lint`, `make student-test`
## 2. Пределы worker