krzysztof-o / spritesheet.js

Command-line spritesheet generator supporting Starling / Sparrow, PIXI.js, Easel.js and cocos2d
Other
551 stars 104 forks source link

Lots of files can cause argument list too long exceptions on child process exec #71

Open freshly-pressed-trousers opened 4 years ago

freshly-pressed-trousers commented 4 years ago

Hi I've been using the lib for a while and it's an absolute joy to use - especially when compared to how I've handled asset management before!

I've come across an issue as I've used it at scale though - for a very large spritesheet in my case including 1k+ individual files which all typically tiny 16x16 sprites I'm getting an argument list too long exception from the imagemagick exec as the length of the imagemagick command resulting from the thousands of chained image paths & composite commands is over the buffer length allowed by a terminal command.

I've forked the repo locally and have a change that fixes it - by batching the transformation calls to imagemagick on top of each other, I'm happy to raise if someone can PR but unsure of if this project is actively maintained?

krzysztof-o commented 4 years ago

hi @freshly-pressed-trousers. I'm glad you liked the lib. The project is no longer actively maintained, but feel free to raise the PR

freshly-pressed-trousers commented 4 years ago

Cheers for the merge!

Bad news though, my "spritesheet" has since expanded to 2k+ files. The exec('identify ' is now failing generator.getImageSizes for the same reason, I will see if I can find time to raise a follow-up PR to batch all exec calls in generator over a certain size, should be possible to create something generic to batch exec calls and keep it clean.

krzysztof-o commented 4 years ago

great, thanks