ed-asriyan / lottie-converter

Converts Lottie Animations (.json / .lottie) and Telegram stickers (*.tgs) to GIF / PNG / APNG / WEBP / WEBM
https://t.me/tgtowabot
MIT License
795 stars 72 forks source link

Windows command line can't handle long commands, so files should not be called one by one #68

Closed Meteor0id closed 2 years ago

Meteor0id commented 2 years ago

gifski -o C:\Userfiles\username\Downloads\Telegram stickers\AnimatedEmojies\000_red_heart.tgs.gif --fps 50 --quality 80 --height 512 --width 512 --quiet C:\Users\username\AppData\Local\Temp\469478d9609b67c53cb8d09c6c25aa08\file-0000.png C:\Users\username\AppData\Local\Temp\469478d9609b67c53cb8d09c6c25aa08\file-0001.png C:\Users\username\AppData\Local\Temp\469478d9609b67c53cb8d09c6c25aa08\file-0002.png C:\Users\username\AppData\Local\Temp\469478d9609b67c53cb8d09c6c25aa08\file-0003.png C:\Users\username\AppData\Local\Temp\469478d9609b67c53cb8d09c6c25aa08\file-0004.png C:\Users\username\AppData\Local\Temp\469478d9609b67c53cb8d09c6c25aa08\file-0005.png

etc. etc.

at least 149 frames called as individual files one by one is too much for the windows command line. Could these be handled like file-*.png

Meteor0id commented 2 years ago

The fix is extremely simple, in index.js const { dir, files } = await saveScreenshots(await render(options.browser, animationData, options)); becomes const { dir, pattern } = await saveScreenshots(await render(options.browser, animationData, options));

and ...files, becomes pattern,

saveScreenshots() already returns pattern as third argument so why wasn't it being used anymore?