Signature upload: crop frame is fixed at 350×100 *image pixels*, so it is tiny on any real photo or scan
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- frontend
Research direction
Start in src/components/Draw/FileUpload.vue and read how defaultStencilSize is passed to vue-advanced-cropper; the issue explains that the object is interpreted in image pixels. Review FileUpload.spec.ts for the related tests and reproduce with a large uploaded image. Done when the initial crop frame covers most of the image while keeping the configured aspect ratio.
Written by the indexing model from the issue text.
Description
Describe the bug
In the signature dialog, tab "Upload", FileUpload.vue passes :default-size="defaultStencilSize" to vue-advanced-cropper. defaultStencilSize is computed from the cropper container width, but the library interprets an object passed as defaultSize as coordinates in image pixels, not screen pixels. For an uploaded image of 3000×1200 px the initial crop frame therefore covers only a few percent of the image (350×100 px of 3000×1200). The user sees a huge image with a minuscule selection and has to resize or zoom a lot before it makes sense. Many users give up at this step.
To reproduce
- Open LibreSign → account page (
/apps/libresign/f/account) → "Signature" → create a new one. - Select tab "Upload" and choose any image larger than about 1000 px wide (a phone photo or scan of a signature).
- Look at the crop frame.
Expected behavior
The initial crop frame covers most of the image (with the configured aspect ratio), as it does when no default-size is given.
Screenshots
Not attached. Measured in the browser with a 3000×1200 px PNG: frame 22×13 CSS px inside a 375×150 CSS px preview (before); 210×120 CSS px after removing :default-size (see below).
Operational System
macOS (headless Chrome 157, automation)
Browser Type and Version
Chrome 157
Libresign Version
15.0.12 (the code is identical on main: src/components/Draw/FileUpload.vue, defaultStencilSize)
Nextcloud Server Version
35.0.2
Logs from Nextcloud Server
Analysis
vue-advanced-cropper 2.8.9, resetCoordinates: if defaultSize is an object it is used directly as the stencil size in image coordinates; if it is not set, the library's own default (stencil covers the visible area) is used.
Possible fix
Drop the default-size binding (patch in upstream-fix.diff, based on main; the two unit tests for defaultStencilSize in FileUpload.spec.ts are removed with it, the suite was not run). Alternative if the "max base size" behavior is wanted: pass a function ({ imageSize }) => … that scales stencilBaseWidth/Height to a fraction of the image.
Logs from Developers tools
No response
Additional context
Analysis
vue-advanced-cropper 2.8.9, resetCoordinates: if defaultSize is an object it is used directly as the stencil size in image coordinates; if it is not set, the library's own default (stencil covers the visible area) is used.
Possible fix
Drop the default-size binding (patch in upstream-fix.diff, based on main; the two unit tests for defaultStencilSize in FileUpload.spec.ts are removed with it, the suite was not run). Alternative if the "max base size" behavior is wanted: pass a function ({ imageSize }) => … that scales stencilBaseWidth/Height to a fraction of the image.
- Dominant language
- PHP
- Stars
- 844
- Forks
- 176
- Avg merge
- 14h 3m
- Merged PRs (30d)
- 344
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from LibreSign/libresign
-
OpenSSL engine: leaf certificates get O=Internet Widgits Pty Ltd, ST=Some-State from system openssl.cnfPossibly taken @vitormattos claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
LibreSign/libresign#9366 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
LibreSign/libresign#9007 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
LibreSign/libresign#8284 · 5 comments ·
Maintainers usually reply within 1 day
-
frontend javascript technical debt
Difficulty 5/5 Over a week Newbie friendliness 8/100
Maintainers usually reply within 1 day
-
frontend help wanted javascript technical debt
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
All issues in LibreSign/libresign
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
35-feedback
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
pluginsGLPI/carbon#396 ·
-
[BUG] Bundle products lose their price in RSS feeds: getPrices() was removedPossibly taken @pcvelz claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
OpenMage/magento-lts#5869 ·
Maintainers usually reply within 2 days