-
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
Fixes crop module bug #1019
Fixes crop module bug #1019
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1019 +/- ##
==========================================
+ Coverage 34.08% 36.98% +2.89%
==========================================
Files 97 99 +2
Lines 1778 1836 +58
Branches 278 287 +9
==========================================
+ Hits 606 679 +73
+ Misses 1172 1157 -15
|
@jywarren please review. |
@Divy123 please have a look!! |
Oh this looks good; can you test out the exact reproducible crop parameters
from the original issue? Thank you!
…On Tue, Apr 16, 2019 at 3:43 PM Slytherin ***@***.***> wrote:
@Divy123 <https://github.com/Divy123> please have a look!!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1019 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ7czxXIvbt_rsaXnnxGE4OP36GiOks5vhie2gaJpZM4czgAY>
.
|
Ah, sorry, actually the even older one, but it runs on the default image:
#213
This had been reliably reproducing the error:
https://sequencer.publiclab.org/examples/#steps=crop{x:127|y:127|w:266|h:266}
However, now maybe we are getting a new error, unfortunately... i'll file
this separately, but i see `Uncaught TypeError: Cannot read property
'description' of undefined` when i use this URL.
…On Tue, Apr 16, 2019 at 4:09 PM Slytherin ***@***.***> wrote:
If I am getting it correct, it means to have a UI test with these
coordinates as input:
[image: Screenshot from 2019-04-17 01-37-46]
<https://user-images.githubusercontent.com/31225007/56240584-8a765700-60b1-11e9-88be-f438447aa1a8.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1019 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJyZNPg1uC3UirCh7Ag5AuIzTWgIaks5vhi3agaJpZM4czgAY>
.
|
And, shall we try adding a module test to protect this feature in the future? We could do a simple image-sequencer/test/core/modules/contrast.js Lines 27 to 40 in 6fa8b1b
|
I'm not so sure. I was still able to reproduce this, on certain values of x and y. I'll recheck and post back here. I was looking into #213 and it's pretty confusing as to why the image is being altered. I'll try and see if it indeed is just a cache issue. |
Maybe it is because of the util functions which are included. I think this only occurs when the offset values are included |
There are some issues related to crop module involving the way pixels are manipulated that's why these problems are arising.
Sure @jywarren!! |
@harshkhandeparkar which of the util functions are you talking about? When we change y ones, there are no errors its perfectly working. |
Probably parseCornerCoordinates. I don't know why I feel like the util func is a prob but I do. |
To this, actually the problem existed even before the utility was added. You can refer #213 is an year old issue. Also the func only generates the exact coordinates if user enters in %. The code you can see and is pretty simple. I don't think there might be a bug. @harshkhandeparkar if you think there is can you point out please towards the line where it can be. |
And there are some good clues on what's causing the color issue... sometimes it's missing a blue channel, sometimes a red channel! So, it seems likely due to a 4-color-channel pixel manipulation error of some kind. |
|
@jywarren the problem is arising when we change the 'x' coordinates and not in case of y coordinates. |
I don't think this is related to imageareaselect. There is somewhat missing in pixel manipulation. |
Ah look at this file https://github.com/publiclab/image-sequencer/blob/main/src/modules/Crop/Crop.js |
@harshkhandeparkar It does not matter if it uses old or new functionality, it should be correct. Looking into it now. Thanks!! |
Maybe the older functionality didn't include the 4th channel, alpha. Anyways, updating to the latest is to be done in any case. |
@jywarren working as desired now!! |
oh this is super. Yes! a test would be wonderful!!!
…On Wed, Apr 17, 2019 at 5:43 PM Slytherin ***@***.***> wrote:
[image: ezgif com-video-to-gif]
<https://user-images.githubusercontent.com/31225007/56322821-ab10e080-6187-11e9-9a21-91fdfa66432d.gif>
@jywarren <https://github.com/jywarren> working as desired now!!
Please have a look!!
Will add the test if it's ok to you!!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1019 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAF6J6DN34S4IGQKCEBCHTPQ6KUVANCNFSM4HGOAAMA>
.
|
What was the problem @Divy123. |
@harshkhandeparkar there were a ceratin number of problems:
|
@Divy123 great catch :D |
@Divy123 why don't you update this to use PixelManipulation API? That will also make it future proof. |
And a lot simpler to read and manage. |
I think restructuring can be made in another PR of all those modules that run on older modules. |
The code-cov increases by 2.89% here after adding the test. |
Awesome!!! |
Great work!!! |
Fixes #987
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
Thanks!