Skip to content
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

Does this work with PNG? #195

Open
mvsrgc opened this issue Mar 10, 2020 · 1 comment
Open

Does this work with PNG? #195

mvsrgc opened this issue Mar 10, 2020 · 1 comment
Labels

Comments

@mvsrgc
Copy link

mvsrgc commented Mar 10, 2020

Does this lib. work with PNG?

let img1 = `data:image/png;base64,${fs.readFileSync(
    './foo.png',
    'base64'
)}`;
let img2 = `data:image/png;base64,${fs.readFileSync(
    './expected_foo.png',
    'base64'
)}`;

resemble(img1).compareTo(img2).onComplete(data => {
    console.log(data);
});

{ error: 'Error: Unsupported image type' }

@jamescryer
Copy link
Member

Seems like there is a bug with data-uri PNG, from my limited testing it would appear the bug was introduced when I updated Resemble to use Canvas v2.6.0.

For now you can try downgading to resemble@3.2.0. Or use another technique for comparing images, such as the one described in this test

test("node buffers png", () => {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants