mirror of
https://github.com/ful1e5/apple_cursor.git
synced 2025-05-23 03:27:08 -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,
|
||||
});
|
||||
|
||||
fs.writeFileSync(
|
||||
path.resolve(process.cwd(), "diff", `${out}.png`),
|
||||
diff.data
|
||||
);
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
const diffFilesPath = path.resolve(process.cwd(), "diff");
|
||||
if (!fs.existsSync(diffFilesPath)) fs.mkdirSync(diffFilesPath);
|
||||
fs.writeFileSync(
|
||||
path.resolve(diffFilesPath, `${out}.png`),
|
||||
PNG.sync.write(diff)
|
||||
);
|
||||
}
|
||||
|
||||
return out;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue