Repository navigation
fix: restore initial crop selection for uploaded signatures - #9528
vitormattos wants to merge 5 commits into
Conversation
lfals
left a comment
There was a problem hiding this comment.
This PR conflicts with main in src/components/Draw/FileUpload.vue (commit 30dca7f7c reformatted the same template attributes). Please rebase and re-run lint and the Node tests.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
|
No actionable comments were generated in the recent review. Summary
Change: Bug fix · Severity of issue fixed: Medium Merge Risk:
|
1eb286a to
19a560b
Compare
Closes #9526
Root cause
FileUpload.vuepassed a fixed-sizedefaultSizeobject derived from the display container tovue-advanced-cropper. The cropper interprets it in source-image coordinates rather than CSS pixels, causing a tiny initial stencil with high-resolution uploads.Fix
signature-width / signature-height), the PNG result and existing zoom controls.ResizeObserver, container-width sizing code and stale assertions.Verified red → green regression
Before the fix —
2d02d914d8d707fa2573e5a5e68587b002dd78ec:defaultSize = {width: 700, height: 200}. Expected: no fixeddefaultSize.After the fix —
5683304f1b61f4cf4581cfee98ff2da8df77e109:PHP image quality and scope
SignatureBackgroundService::scaleDimensions()already preserves smaller stamp-background images and proportionally downsizes images larger than 3× the configured full stamp dimensions;SignatureBackgroundServiceTestcovers both cases. This is the stamp background, not the user's cropped signature. The latter is validated as PNG (including a 5 MiB size limit) inFileInputValidatorand stored bySignerElementsService. The signing engine controls final PDF rendering.No PHP image processing, resolution rules or file validation are changed by this PR.
Validation limitation
The regression checks the Vue component's integration contract with the cropper and the preserved aspect ratio. It does not assert actual CSS-frame measurements in a real browser using a 3000×1200 image; those measurements were supplied in the original issue report.
Both commits were made with signed DCO trailers.
Follow-up from code review (2026-11-18)
The original change fixes the initial stencil, but a high-entropy 3000 px image can now export a PNG larger than the backend's 5000 KiB visible-element limit.
b5bb0d2, NPM lint failed on@stylistic/multiline-ternaryatFileUpload.vue:218,220, while the Node tests passed. Both ESLint formatting errors were addressed in 4c2cc7d, a signed DCO commit without a logic change. The new CI for this head is running; it must finish before merge.