polotno-node
Advanced tools
Comparing version 2.6.7 to 2.6.8
{ | ||
"name": "polotno-node", | ||
"version": "2.6.7", | ||
"version": "2.6.8", | ||
"description": "Polotno workflow from NodeJS", | ||
@@ -29,6 +29,6 @@ "main": "index.js", | ||
"pngjs": "^7.0.0", | ||
"polotno": "^2.0.2", | ||
"polotno": "^2.0.5", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"vite": "^4.4.11" | ||
"vite": "^4.5.0" | ||
}, | ||
@@ -39,4 +39,4 @@ "author": "Anton Lavrenov", | ||
"@sparticuz/chromium": "117.0.0", | ||
"puppeteer": "^21.3.8", | ||
"puppeteer-core": "^21.3.8" | ||
"puppeteer": "^21.4.0", | ||
"puppeteer-core": "^21.4.0" | ||
}, | ||
@@ -43,0 +43,0 @@ "bugs": { |
22
video.js
@@ -66,3 +66,3 @@ const fs = require('fs'); | ||
process.stdout.cursorTo(0); | ||
process.stdout.write(progress + '%'); | ||
process.stdout.write('Rendering frame: ' + progress + '%'); | ||
} | ||
@@ -89,2 +89,5 @@ | ||
await store.waitLoading(); | ||
// TODO: we need to active all pages first | ||
// disable text fit, as it is already should be processed | ||
window.config.unstable_setTextOverflow('resize'); | ||
}, | ||
@@ -105,6 +108,15 @@ json, | ||
for (let i = 0; i < frames; i++) { | ||
const currentTime = i * timePerFrame; | ||
let currentTime = i * timePerFrame; | ||
if (i === 0) { | ||
// offset the very first frame to enable animation start | ||
currentTime = 1; | ||
} | ||
if (i === frames - 1) { | ||
// offset the very last frame to enable animation end | ||
currentTime = duration - 1; | ||
} | ||
const dataURL = await page.evaluate( | ||
async (json, attrs, currentTime) => { | ||
store.setCurrentTime(currentTime + 1); | ||
store.setCurrentTime(currentTime); | ||
const currentPage = store.pages.find((p) => { | ||
@@ -127,3 +139,3 @@ return ( | ||
); | ||
const progress = ((i / frames) * 100).toFixed(1); | ||
const progress = ((i / (frames - 1)) * 100).toFixed(1); | ||
printProgress(progress); | ||
@@ -134,2 +146,4 @@ fs.mkdirSync('./tmp', { recursive: true }); | ||
console.log('\nRendering video'); | ||
await new Promise((resolve, reject) => { | ||
@@ -136,0 +150,0 @@ ffmpeg() |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1131467
4832
1
Updatedpuppeteer@^21.4.0
Updatedpuppeteer-core@^21.4.0