Image code: shared module for step and cover images #30
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MassiveDynamic/kataba#30
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #18 (PR #29), from its code review.
What
Since #18, step images and cover images share the upload pipeline, the guarded media route and the crop editor, but the shared code still lives under
src/stepImages/and is partly duplicated. Tidy it up without changing behaviour. See ADR-0006.Acceptance criteria
files,storage,processImage,crop,cropForm,upload,href,access,CropDialog) moves fromsrc/stepImages/to its own module (e.g.src/images/);src/stepImages/andsrc/coverImages/keep only what is specific to themrecropStepImageandrecropCoverImageshare one re-crop flow (read crop → read original → render variants → swap row in a locked transaction → delete the loser's variants); only the row swap differs{original, crop}), replacingcropFields,croppedImage/StoredImagein the guide edit page and the inline field lists in the re-crop actionsFILE_HINTvs.UPLOAD_HINT;callin the image editorsOut of scope / noticed
variants/<id>/directory behind (diskStorage.delete); could be cleaned up here or separately.coverTileImagealways declares the medium variant as960w, although variants are rendered without enlargement and a crop can be as small as 160 px.Vocabulary: GLOSSARY.md. Decisions: docs/adr/.
Done in PR #36: shared image code now lives in src/images/, one re-crop flow (recropImage), one crop mapping (storedCrop), call/run renamed in the editors. The two out-of-scope notes (empty variant dirs, 960w in coverTileImage) are not addressed.