mirror of
https://github.com/ful1e5/apple_cursor.git
synced 2025-05-23 11:37:04 -04:00
🚀 Store diff files from pixelMatcher
This commit is contained in:
parent
9c22d7c5af
commit
27113e4e7a
1 changed files with 9 additions and 4 deletions
|
@ -14,9 +14,14 @@ export const matchImages = (img1Buff: Buffer, img2Buff: Buffer) => {
|
||||||
threshold: 0.3,
|
threshold: 0.3,
|
||||||
});
|
});
|
||||||
|
|
||||||
fs.writeFileSync(
|
if (process.env.NODE_ENV === "development") {
|
||||||
path.resolve(process.cwd(), "diff", `${out}.png`),
|
const diffFilesPath = path.resolve(process.cwd(), "diff");
|
||||||
diff.data
|
if (!fs.existsSync(diffFilesPath)) fs.mkdirSync(diffFilesPath);
|
||||||
);
|
fs.writeFileSync(
|
||||||
|
path.resolve(diffFilesPath, `${out}.png`),
|
||||||
|
PNG.sync.write(diff)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue