fix: preserve uploaded signature orientation in Firefox - #7321
Open
mvanhorn wants to merge 1 commit into
Open
Conversation
mvanhorn
requested review from
ConnorYoh,
EthanHealy01,
Frooodle,
jbrunton96 and
reecebrowne
as code owners
August 7, 2026 09:57
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
Normalize an uploaded raster signature once in
ImageUploaderby drawing the browser-decoded image to a correctly sized canvas and emitting a PNG data URL, thereby baking the displayed orientation into the pixels and removing orientation metadata beforeSignSettingsstoressignatureData. Keep the existing SVG-to-PNG path and preserve transparency, while making the normalized raster data theoriginalImageDataused both with background removal disabled and when that option is toggled so the raw oriented JPEG cannot re-enter the flow. Retain the existing callback contract (onImageChangereceives the selected file andonProcessedImageDatareceives embeddable image data), so no signing-context or PDF-flattening wiring changes are required.Uploaded image signatures can look correctly oriented while being placed in Firefox, then appear rotated by 90 degrees after the user applies them to the PDF. The reporter reproduced the problem on version 2.7.3 and again after upgrading to the latest release, narrowing it to the current upload-and-apply path rather than an already-fixed release defect.
ImageUploadercurrently forwards non-SVG raster files as their original data URLs, allowing browser-specific handling of JPEG orientation metadata to reach the stamp preview and final PDF image pipeline in different forms. The fix is limited to image-based signatures; drawn and typed signatures should remain unchanged.Closes #7297
Checklist
Not applicable to this change.
General
Documentation
Translations (if applicable)
scripts/counter_translation.pyNot run: no test command resolved in this workspace, so nothing was executed to pass.
UI Changes (if applicable)
Not verified: this needs a person on the named hardware or environment.
Testing (if applicable)
task checkto verify linters, typechecks, and tests passNot run: no test command resolved in this workspace, so nothing was executed to pass.
onProcessedImageDatareceives a PNG whose canvas dimensions and drawn orientation match the displayed image rather than the raw JPEG dimensions. - Upload an ordinary raster image with transparency; verify normalization keeps its width, height, and alpha-bearing PNG output and still callsonImageChangewith the originalFile. - Toggle white-background removal after an oriented image is selected; verify processing starts from the normalized PNG and does not restore the original metadata-bearing data URL.