-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
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
Support node-only image packing #29
Comments
See the discussion at twolfson/spritesmith#55 |
I hacked out a working proof-of-concept fairly quickly. Still need to make the engine configurable, and add some tests. https://github.com/ericlathrop/pixi-packer/commit/6fb00567fe125f96d9fcc4fd89df57f41353be30 |
I wanted to make sure |
First, thanks for looking at this 👍 As you've probably seen, the bits in https://github.com/Gamevy/pixi-packer/blob/master/lib/image_processor.js would need redoing. The best way of having multiple options might be to go down a similar route as spritesmith's engine modules. Don't worry about that bit for now though, I'm happy to pick up a working branch and separate the modules out. I've looked at gm's source code, if you want to make sure it can't use gm, you could edit https://github.com/aheckmann/gm/blob/master/lib/command.js#L206 in your |
I tried getting
...meaning people can't even install this module without having ImageMagick installed. I was hoping to just leave |
yes, I'm fine with that, version numbers are cheap. There could be two engine-modules, one for gm and one for pure node. Whether or not there should be a default one that has no side-effects (like spritesmith does with pixelsmith) is something we can decide later. |
Just to keep you updated, I was able to write a pure-javascript image scaling function using the |
Here's the scaling code, in case you're curious: https://github.com/ericlathrop/scale-image/blob/master/index.js |
That looks good! 👍 |
I've gotten the pure-javascript The next thing to do is integrate these code chunks into |
That looks great! thanks for doing that, looking forward to seeing it all come together. Enjoy your vacation! |
@ericlathrop Just a heads up, I've done some refactoring on This should make your work easier, but you might however have to do some rebasing on your fork. Sorry about that :( |
I'd like to avoid requiring users to install ImageMagick for an easier setup experience across win/mac/linux. Since pixi-packer uses the
gmsmith
engine fromspritesmith
, maybe we can have a configuration option to use thepixelsmith
engine. I'm willing to work on a PR for this if its something that could be accepted.The text was updated successfully, but these errors were encountered: