jest-image-snapshot icon indicating copy to clipboard operation
jest-image-snapshot copied to clipboard

Integrate odiff with image snapshot

Open Quintessent opened this issue 4 years ago • 8 comments

I am working on a program where we need to run a huge amount of visual tests for big images (full-hd and bigger) and image comparison takes too much time on CI.

Is it possible to use some kind of more performant library like this https://github.com/dmtrKovalenko/odiff with your tool?

Quintessent avatar Jan 30 '21 16:01 Quintessent

Implementation could reuse what has been done to introduce the ssim diff lib in #220

tbouffard avatar Feb 01 '21 17:02 tbouffard

So can i make a pull request for this?

Quintessent avatar Feb 16 '21 17:02 Quintessent

This issue is stale because it has been open 30 days with no activity.

github-actions[bot] avatar Mar 19 '21 00:03 github-actions[bot]

@JamesSingleton @anescobar1991 would you be interesting in reviewing/integrating a Pull Request on that topic if @Quintessent and/or I provide a Pull Request to implement an odiff integration?

tbouffard avatar Mar 19 '21 05:03 tbouffard

This issue is stale because it has been open 30 days with no activity.

github-actions[bot] avatar Apr 20 '21 00:04 github-actions[bot]

odiff support has been referenced in https://github.com/americanexpress/jest-image-snapshot/issues/210#issuecomment-747906665

tbouffard avatar Apr 20 '21 17:04 tbouffard

This issue is stale because it has been open 30 days with no activity.

github-actions[bot] avatar May 21 '21 00:05 github-actions[bot]

@Quintessent Are you still interested to make a PR?

From what I see, it should be fairly straight forwards to integrate this:

const { compare } = require("odiff-bin");

const { match, reason } = await compare(
  "path/to/first/image.png",
  "path/to/second/image.png",
  "path/to/diff.png"
);

tujoworker avatar Jan 30 '23 19:01 tujoworker