Repository navigation
feat: Add options.ignoreMask of pixels to skip - #171
Conversation
|
OX Security reviewed this pull request — nothing to fix.
Branch |
mourner
left a comment
There was a problem hiding this comment.
Looks like a bunch of tests are failing — let's make sure the CI is green first
722d8a9 to
f3ee790
Compare
Woops, was refactoring and made a mistake in the if-statement. Should've been - if (!inIgnoreMask && a32[i] === b32[i]) {
+ if (!inIgnoreMask && a32[i] !== b32[i]) { |
f3ee790 to
4109469
Compare
|
Also, it seems like adding two sets of fixtures for this is a bit redundant — we could get away with just one (one darker, and a diff that shows only the non-masked portion was highlighted). |
Would you say 9a and 9b is enough then? I added fixture 10 to ensure check the fast check works with it |
|
Ah, I guess we could leave those then. So, a few nits left and I'll land this before v8 release. |
7a54774 to
d90a958
Compare
New check where if a value from `ignoreMask` is greater than 0 it will be ignored from the check. The ignore mask itself needs to be exact width and height of the images provided. One could write an array manually or provide a PNG image by use of a custom helper function beforehand, further making it more extensible. Any value greater than 0 will be skipped. Tests have been updated to include one test with a normal diff check with an ignore mask that covers half the screen, and another diff check where nothing should differ as all the changes are within the ignore mask but makes sure the fast path is executed. Fixes: mapbox#163 Closes: mapbox#153 Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
d90a958 to
6e6a65c
Compare
|
Alrighty, updated based on last review. Updated the fast check as I had an incorrect statement there so it would never mark identical if it was inside an ignore change. Before we go ahead with merging this, do we agree on |
|
Great, thanks for being patient and getting this over the finish line! |
New check where if a value from
ignoreMaskis greater than 0 it willbe ignored from the check. The ignore mask itself needs to be exact
width and height of the images provided.
One could write an array manually or provide a PNG image by use of a
custom helper function beforehand, further making it more extensible.
Any value greater than 0 will be skipped.
Tests have been updated to include one test with a normal diff check
with an ignore mask that covers half the screen, and another diff check
where nothing should differ as all the changes are within the ignore mask but makes sure the fast path is executed.
Fixes: #163
Closes: #153