Parse floating-point value from percentages (#1733)

* Parse floating-point value from percentages

* Add tests for resize module

* Add options' test for resize module

Co-authored-by: Aditya Zope <zope@Adityas-MacBook-Pro.local>
Co-authored-by: Harsh Khandeparkar <34770591+HarshKhandeparkar@users.noreply.github.com>
This commit is contained in:
Aditya Zope
2020-11-02 10:38:36 +05:30
committed by GitHub
parent 0622a0c21a
commit 893bc108e0
2 changed files with 20 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ const imagejs = require('imagejs'),
pixelSetter = require('../../util/pixelSetter'),
ndarray = require('ndarray');
module.exports = function Resize(pixels, options) {
const resize_value = parseInt(options.resize.slice(0, -1));
const resize_value = parseFloat(options.resize);
if (resize_value == 100) return pixels;