mirror of
https://github.com/ful1e5/apple_cursor.git
synced 2025-05-23 19:47:05 -04:00
🔧 utils name changed
This commit is contained in:
parent
491aef4df1
commit
90dd95e545
2 changed files with 4 additions and 4 deletions
|
@ -11,7 +11,7 @@ import {
|
||||||
} from "./config";
|
} from "./config";
|
||||||
import { matchImages } from "./utils/matchImages";
|
import { matchImages } from "./utils/matchImages";
|
||||||
import { saveFrames, Frames } from "./utils/saveFrames";
|
import { saveFrames, Frames } from "./utils/saveFrames";
|
||||||
import { getKeyName } from "./utils/getKeyName";
|
import { getFrameName } from "./utils/getFrameName";
|
||||||
|
|
||||||
const main = async () => {
|
const main = async () => {
|
||||||
const browser = await puppeteer.launch({
|
const browser = await puppeteer.launch({
|
||||||
|
@ -71,7 +71,7 @@ const main = async () => {
|
||||||
let index = 1;
|
let index = 1;
|
||||||
let breakRendering = false;
|
let breakRendering = false;
|
||||||
const frames: Frames = {};
|
const frames: Frames = {};
|
||||||
const firstKey = getKeyName(index, svgPath);
|
const firstKey = getFrameName(index, svgPath);
|
||||||
|
|
||||||
console.log("Rendering", path.basename(svgPath), "...");
|
console.log("Rendering", path.basename(svgPath), "...");
|
||||||
console.log(firstKey);
|
console.log(firstKey);
|
||||||
|
@ -93,7 +93,7 @@ const main = async () => {
|
||||||
clip: animatedClip,
|
clip: animatedClip,
|
||||||
encoding: "binary",
|
encoding: "binary",
|
||||||
});
|
});
|
||||||
const key = getKeyName(index, svgPath);
|
const key = getFrameName(index, svgPath);
|
||||||
console.log(key);
|
console.log(key);
|
||||||
const diff = matchImages({
|
const diff = matchImages({
|
||||||
img1Buff: frames[firstKey].buffer,
|
img1Buff: frames[firstKey].buffer,
|
||||||
|
|
|
@ -8,7 +8,7 @@ export const frameNumber = (index: number, endIndex: number) => {
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getKeyName = (index: number, fileName: string) => {
|
export const getFrameName = (index: number, fileName: string) => {
|
||||||
const frame = frameNumber(index, 2);
|
const frame = frameNumber(index, 2);
|
||||||
return `${path.basename(fileName, ".svg")}-${frame}.png`;
|
return `${path.basename(fileName, ".svg")}-${frame}.png`;
|
||||||
};
|
};
|
Loading…
Add table
Add a link
Reference in a new issue