diff --git a/CHANGELOG.md b/CHANGELOG.md index 2396037e..96428dde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.1.1-stage.1 (2026-02-13) + +* fix: simplify resize percentage calculations (#387) ([77c71c3](https://github.com/aziontech/lib/commit/77c71c3)), closes [#387](https://github.com/aziontech/lib/issues/387) + ## 3.1.0 (2026-02-11) * Merge pull request #386 from aziontech/stage ([375d97b](https://github.com/aziontech/lib/commit/375d97b)), closes [#386](https://github.com/aziontech/lib/issues/386) diff --git a/package.json b/package.json index 967c0dc0..c62bac04 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "azion", - "version": "3.1.0", + "version": "3.1.1-stage.1", "description": "Azion Packages for Edge Computing.", "scripts": { "prepare": "husky", diff --git a/packages/wasm-image-processor/src/index.ts b/packages/wasm-image-processor/src/index.ts index 757c8880..f6df2ddc 100644 --- a/packages/wasm-image-processor/src/index.ts +++ b/packages/wasm-image-processor/src/index.ts @@ -10,11 +10,11 @@ function resize(image: photon.PhotonImage, width: number, height: number, usePer const imageWidth = image.get_width(); const imageHeight = image.get_height(); - const widthPercent = usePercent ? width : (width * 100.0) / imageWidth; - const heightPercent = usePercent ? height : (height * 100.0) / imageHeight; + const widthPercent = usePercent ? width : width / imageWidth; + const heightPercent = usePercent ? height : height / imageHeight; - const newWidth = (imageWidth * widthPercent) / 100; - const newHeight = (imageHeight * heightPercent) / 100; + const newWidth = imageWidth * widthPercent; + const newHeight = imageHeight * heightPercent; return photon.resize(image, newWidth, newHeight, 1); }