Skip to content

fix: simplify resize percentage calculations#387

Merged
jcbsfilho merged 1 commit intostagefrom
fix/image-resize
Feb 13, 2026
Merged

fix: simplify resize percentage calculations#387
jcbsfilho merged 1 commit intostagefrom
fix/image-resize

Conversation

@jcbsfilho
Copy link
Collaborator

This pull request updates the image resizing logic in the resize function to simplify and correct the calculation of new image dimensions. The main change is to remove unnecessary percentage-based calculations when resizing images.

Image resizing logic update:

  • Simplified the calculation of widthPercent and heightPercent so that when usePercent is false, the values are computed as simple ratios rather than percentages, and updated the calculation of newWidth and newHeight accordingly in packages/wasm-image-processor/src/index.ts.

- simplify resize percentage calculations by removing redundant multiplications
@jcbsfilho jcbsfilho requested a review from a team as a code owner February 13, 2026 13:40
@jcbsfilho jcbsfilho changed the base branch from main to stage February 13, 2026 13:40
@github-actions
Copy link

SCC Complexity Analysis

  • Title: fix: simplify resize percentage calculations
  • Author: jcbsfilho
Metric Source Branch (fix/image-resize) Target Branch (main) Difference
Complexity 2324 2324 0
Code 48642 48642 0

@jcbsfilho jcbsfilho merged commit 77c71c3 into stage Feb 13, 2026
11 checks passed
@jcbsfilho jcbsfilho deleted the fix/image-resize branch February 13, 2026 17:02
pablodiehl pushed a commit that referenced this pull request Feb 13, 2026
[skip ci]
## <small>3.1.1-stage.1 (2026-02-13)</small>

* fix: simplify resize percentage calculations (#387) ([77c71c3](77c71c3)), closes [#387](#387)
@pablodiehl
Copy link
Collaborator

🎉 This PR is included in version 3.1.1-stage.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

pablodiehl pushed a commit that referenced this pull request Feb 13, 2026
[skip ci]
## <small>3.1.1 (2026-02-13)</small>

* Merge pull request #389 from aziontech/stage ([c9bff59](c9bff59)), closes [#389](#389)
* chore(release): 3.1.1-stage.1 ([ce0ff91](ce0ff91))
* fix: simplify resize percentage calculations (#387) ([77c71c3](77c71c3)), closes [#387](#387)
@pablodiehl
Copy link
Collaborator

🎉 This PR is included in version 3.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants