Skip to content

custom resize option in resize module - #1598

Draft
sharmamansi wants to merge 5 commits into
publiclab:mainfrom
sharmamansi:customized_resize_option
Draft

custom resize option in resize module#1598
sharmamansi wants to merge 5 commits into
publiclab:mainfrom
sharmamansi:customized_resize_option

Conversation

@sharmamansi

Copy link
Copy Markdown

Fixes #1298

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with npm run test-all
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • ask @publiclab/is-reviewers for help, in a comment below
  • Insert-step functionality is working correct as expected.

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
Please make sure to get at least two reviews before asking for merging the PR as that would make the PR more reliable on our part
Thanks!

@sharmamansi

Copy link
Copy Markdown
Author

@publiclab/is-reviewers @keshav234156 please review this

@ataata107

Copy link
Copy Markdown

can you attach a working GIF.

@sharmamansi

Copy link
Copy Markdown
Author

20200208_201726

@sharmamansi

Copy link
Copy Markdown
Author

@ataata107 please review this

const checkbox = Number(options.checkbox);

if (resize_value == 100) return pixels;
if (resize_height == 100) return pixels;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be changed as we cant return the pixels if the new height is 100 because original image height may not be 100

"type": "preserve aspect ratio",
"desc": "Percentage value of the resize",
"default": "125%"
"default": "0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default should still be 125% for making the tests pass also make the default value of checkbox to be one

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you have seen my initial commit this was a mistake description should be the value of checkbox and I can't make it's default 125 as it can be 0 or 1 only.

var new_width = Math.round(pixels.shape[0] * (resize_width / 100)),
new_height = Math.round(pixels.shape[1] * (resize_height / 100));
}
var new_width = Math.round(pixels.shape[0] * (resize_height / 100)),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this?

@gitpod-io

gitpod-io Bot commented Jul 7, 2020

Copy link
Copy Markdown

@harshkhandeparkar
harshkhandeparkar marked this pull request as draft July 27, 2021 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom Resize Option in Resize Module

5 participants