Skip to content

Diff Image getting generated intermittently #20

@SimitTomar

Description

@SimitTomar

Hi,

I am trying to compare 2 images but the diff image is getting generated intermittently. Mentioned below is my code:

    var resemble = require('node-resemble-js');
    var fs = require('fs');

   function CompareImages(){

    var imgData1 = "C:\\Users\\stoma1\\Desktop\\ff1.png";
    var imgData2 = "C:\\Users\\stoma1\\Desktop\\ff2.png";


    resemble(imgData1).compareTo(imgData2).ignoreNothing().onComplete(function (data) {
        var png = data.getDiffImage().pack()
        png.pack().pipe(fs.createWriteStream('./diff.png'));

      });
    }

At times, when the diff.png gets generated its of 0 size, got the correct image with difference highlighted once.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions