fix: Failed scaling of uploaded signature - #8002
Open
Roshan931 wants to merge 2 commits into
Open
Conversation
|
Thanks for opening your first pull request in this repository! ✌️ |
vitormattos
requested changes
Aug 21, 2026
| $mergedPath = self::invokePrivate($this->getInstance(), 'mergeBackgroundWithSignature', [ | ||
| $backgroundPath, | ||
| $signaturePath, | ||
| 5.0, |
Member
There was a problem hiding this comment.
Would be best to use the constant SCALE_FACTOR_MIN because duplicating the value here couples the test to that implementation detail. Ideally the test should exercise the behavior without needing to know the exact minimum value.
| $this->assertStringNotContainsString(' -cl ' . DocMdpLevel::CERTIFIED_FORM_FILLING_AND_ANNOTATIONS->name, $paramsSeen[0]); | ||
| } | ||
|
|
||
| public function testMergeBackgroundWithSignatureFitsOversizedSignatureInsideStampBox(): void { |
Member
There was a problem hiding this comment.
Maybe it would be good to use #[DataProvider('signatureDimensionsProvider')] here to cover different aspect ratios:
public static function signatureDimensionsProvider(): array {
return [
'same aspect ratio' => [1400, 400],
'wider signature' => [1400, 200],
'taller signature' => [700, 800],
];
}This would keep the regression case and also verify the new behavior with wider and taller signatures.
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.
Fixes #7981
Root cause
Uploaded signature PNG is composited at pixel-size × scale factor instead of being fitted into the stamp box
Changes