-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added aspect ratio module #1454
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1454 +/- ##
=====================================
Coverage 65.5% 65.5%
=====================================
Files 128 128
Lines 2618 2618
Branches 420 420
=====================================
Hits 1715 1715
Misses 903 903
|
@publiclab/is-reviewers |
@jywarren @harshkhandeparkar @root00198 Do we actually need this as a separate module if we have already resize module? Though implementing aspect ratio is a good idea but it would be better if we have within resize module and we already have an issue for it #1298 |
@keshav234156 As far as I can understand, resize module reduces the width and height of the image according to a certain percentage, whereas the aspect ratio module changes the height and width of the image by croping it and aspect ratio module also consider the point from where to start the croping which resize module might not. |
Yes I agree with @keshav234156 but we can have this as an addition in crop module, there we could provide an input field for aspect ratio, what do you think? |
@harshkhandeparkar @jywarren what do you say? |
Hey, how about making this a meta module? You won't have to write any extra code. |
I would have to write some code regardless, because of the calculations (regarding the resulting width and height) needed to be done before passing the execution to the crop module. |
Do meta modules use internal sequencer? If yes, then this would faster. You know what, don't use meta modules. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think AspectRatioCrop
or RatioCrop
or LockedCrop
would be a better name?
AspectRatioCrop feels more like it. @harshkhandeparkar what do you say, should I change the module name? |
Sure, change it. |
Wait! |
I just checked. |
yeah that feels much better. let's do it. |
👍 |
Also working on adding the test for this module. |
Awesome! |
LGTM. Just waiting for travis to complete. |
Great work here! Do we feel that this is similar enough to the regular crop that it could be included as a configurable param for that module? |
It could be included as a part of the crop module. |
This module helps to crop an image, on the basis of the resulting aspect ratio.
In Browser Usage
In Command Line Interface
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
npm test
@publiclab/is-reviewers
for help, in a comment belowIf 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!