We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
letimages = ['urls'] console.log('images =', images); await delay(4000, {value: '🦄'}); const encoder = new GIFEncoder(1000, 1000); encoder.createReadStream().pipe(fs.createWriteStream(activity_time+'_frames_'+total_frames+'.gif')); encoder.start(); encoder.setRepeat(0); // 0 for repeat, -1 for no-repeat encoder.setDelay(500); // frame delay in ms encoder.setQuality(10); // image quality. 10 is default. const canvas = createCanvas(1000, 1000); const ctx = canvas.getContext('2d'); await delay(300, {value: '🦄'}); const image = await new Promise(async (resolve,reject)=>{ for(let i=0; i<images.length; i++){ console.log('image url ',images[i].url); var data = await download_images_from_url(images[i].url); // function return's image binary data var img = new Canvas.Image; img.src = data; ctx.drawImage(img, 0, 0, 1000, 1000); await delay(500, {value: '🦄'}); encoder.addFrame(ctx); if(i==(images.length)-1){ resolve('success'); } } }) encoder.finish(); console.log('image created')
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When i add delay it working fine if i missed the delay it through the error of image can't able to create
letimages = ['urls'] console.log('images =', images); await delay(4000, {value: '🦄'}); const encoder = new GIFEncoder(1000, 1000); encoder.createReadStream().pipe(fs.createWriteStream(activity_time+'_frames_'+total_frames+'.gif')); encoder.start(); encoder.setRepeat(0); // 0 for repeat, -1 for no-repeat encoder.setDelay(500); // frame delay in ms encoder.setQuality(10); // image quality. 10 is default. const canvas = createCanvas(1000, 1000); const ctx = canvas.getContext('2d'); await delay(300, {value: '🦄'}); const image = await new Promise(async (resolve,reject)=>{ for(let i=0; i<images.length; i++){ console.log('image url ',images[i].url); var data = await download_images_from_url(images[i].url); // function return's image binary data var img = new Canvas.Image; img.src = data; ctx.drawImage(img, 0, 0, 1000, 1000); await delay(500, {value: '🦄'}); encoder.addFrame(ctx); if(i==(images.length)-1){ resolve('success'); } } }) encoder.finish(); console.log('image created')
The text was updated successfully, but these errors were encountered: