blink-diff icon indicating copy to clipboard operation
blink-diff copied to clipboard

Error with perceptual mode

Open stevenvachon opened this issue 9 years ago • 6 comments

TypeError: Cannot read property 'R' of undefined
    at Object._correctGamma (/project/node_modules/blink-diff/index.js:933:21)
    at Object._getColor (/project/node_modules/blink-diff/index.js:909:17)
    at Object._pixelCompare (/project/node_modules/blink-diff/index.js:1119:19)
    at Object._compare (/project/node_modules/blink-diff/index.js:1191:29)
    at Object.<anonymous> (/project/node_modules/blink-diff/index.js:432:18)
    at /project/node_modules/promise/lib/core.js:33:15
    at flush (/project/node_modules/asap/asap.js:27:13)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
new BlinkDiff({
  hideShift: true,  // hide anti-aliasing differences
  imageA: imageA,
  imageB: imageB,
  perceptual: true
})

stevenvachon avatar Sep 19 '16 19:09 stevenvachon

I will look into this tonight. But, if you could supply me more data.

Does this work when you do perceptual: false? Do you have an example image?

marcelerz avatar Sep 19 '16 19:09 marcelerz

It works with perceptual not defined, which defaults to false, so I think it's safe to answer "yes".

All of my images threw the same error, but here're two: buttons-linux buttons-osx

stevenvachon avatar Sep 19 '16 19:09 stevenvachon

This is an easy fix, but there is no work-around. Needing to wait until it is merged and pushed as new version to NPM.

marcelerz avatar Sep 22 '16 07:09 marcelerz

You can try using "https://github.com/preceptorjs/blink-diff" until then.

marcelerz avatar Sep 22 '16 08:09 marcelerz

Thanks!

stevenvachon avatar Sep 22 '16 12:09 stevenvachon

Still see this issue with version 1.0.13. Is this fixed? Thanks.

gaurav517 avatar Jul 16 '19 08:07 gaurav517