Closed meterscao closed 11 years ago
The gm
engine relies on graphics-magick to be installed. If you are not specifying gm
as your engine, spritesmith
should automatically use phantomjs
or node-canvas
instead if possible.
Please refer to the README for more specifications on the gm
requirements.
// OPTIONAL: Specify engine (auto, canvas, gm) 'engine': 'gm', I have specified the gm as the engine
Okie doke, then you will need to install graphics-magick as instructed in my previous comment. Please refer to the README as also specified. Let me know if you have any troubles.
Oh sorry , I pasted the wrong picture. GM has been installed...
Graphics magick can change a lot between versions (even 1.3.18
and 1.3.17
), can you please install 1.3.17
?
Also, if you have installed this after those node_modules
were installed, spritesmith
saw that you were missing graphics-magick
and did not install its engine for gm
. To remedy that, delete the node_modules
directory and run npm install
once more.
Sorry, I have to go to sleep so please don't think I am ignoring you if you respond. I should reply within the next 24 hours if you comment.
Thanks a lot ~ Good night? It is 16:52 in China. I am checking.
Hi good morning;)
I have installed GM 1.3.17, and it runs good.
But I just got another problem: I want to combine images from slice/
to sprite/
.
When the slice/
directory was empty ,it would be great with Done,without error
and an empty sprite.png
will be created in sprite/
.
But if the slice/
directory contains any image ,it would be wrong ,and says Fatal error: spawn ENOENT
.
I tested it in Windows.
Glad to hear it works =)
This sounds like a problem with the gm
engine and your machine. Can you clone twolfson/gmsmith, run npm install
, run npm test
, and copy/paste the results?
Okay~, I installed the gmsmith
And test it
Ah, this looks like an issue to the one in #17. Unfortunately, I couldn't get it patched since the reporter lacked knowledge of node
and I didn't have a non-English version of Windows.
I am going to check in on other issues that have collected today and get back to you on this. I believe it will be a lot of patching utf8
to utf16
but not 100% certain.
Alright, took care of the others. Back to looking into this.
Good news, my Windows VM seems to be having troubles as well.
Okay, I hope this is not just an issue with the test suite ordering. Can you checkout gmsmith
on 0.1.3
, re-install its node_modules
, and run npm test
?
I have discovered that the test suite is now breaking as of 0.2.0
for Windows due to some imagemagick
support.
Ok,I have re-installed the 0.1.3
but it run error.
Well that's not good. I am going to patch up this bug so I have a stable point to help you further.
Thanks a lot . You are very kind.
Alright, I decided to take the short path and disable the imagemagick
test for now. The patch became a rabbit hole of tedious updates. Looking into utf16
support now.
Looks like I was imagining utf16
existing. But it also is not in my code base. Can you translate the error message to English for me?
Er, it means 'doubleshot' is not a command.
Ah, I think that is being caused by the way you are testing it. Can you install its devDependencies
? This is why I was saying to clone
the repo and run npm install
inside of it.
To explain further, doubleshot
is the testing framework gmsmith
uses but it is not a normal dependency, it is marked as under devDependencies
. This is so you don't have to download it if you are going to use the module without the need to test it.
I run npm install
inside of the directory ,and run npm test
:
Great! Can you do the same on 0.2.1
? That is the patched version that doesn't run imagemagick
tests.
It will also be the one used by grunt-spritesmith
.
That doesn't make much sense, I disabled the imagemagick
test but the other 2 tests are passing which is good.
I would ask you to re-install node_modules but I don't think that will change anything. I think it is time to move up to spritesmith. Can you clone that repo, run npm install
, and npm test
?
I download your spritesmith
source code ,and run npm install
and `npm test.
The result is :
Great! That looks good too. The reason those tests are failing is:
padding
is a new feature and I haven't taken the time to generate/save the image for each enginecanvassmith
uses node-canvas
which is not Windows compatibleOnwards to grunt-spritesmith, please clone, npm install
, and npm test
.
I hope this would not waste you too much time.
I got an alert:
No worries; it is worth it to save you a lot of time with spritesheets. Bonus points if we discover bugs.
Ah, I think I might be executing it weird. Could you go into src-test
and run grunt
by hand?
I run grunt
in the src-test
and it gives me the same alert~
If that still fails, what version of grunt
or grunt-cli
do you have globally installed?
Okay, can you delete the grunt.js
file in src-test
and re-run grunt
?
The same error alert ;(
Alright, I am going to attempt to reproduce.
Okay, I could not reproduce in full but I did run into an issue with what I told you to do. Can you git reset --hard
(reset changes we made), git fetch
, git checkout bug/inspect.windows
, and run grunt
inside of src-test
?
sorry, I do not use git
for getting the source code , I just downloaded the release...
Could I delete the folder and do this again?
Unfortunately, I have made updates in a different branch which is changed via git checkout
. You can make the same changes though. They were:
src-test/grunt.js
to src-test/grunt2.js
src-test/Gruntfile.js
, update require('./grunt')(grunt);
to require('./grunt2')(grunt);
Then, run grunt
inside of src-test
.
It looks great= =
Okay... can you go back to your project, re-install node_modules
, and try running grunt
again?
I run npm install
in my project folder, and I got this
And then I run grunt
, I got this
This is my Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
pkg:grunt.file.readJSON("package.json"),
'sprite': {
'all': {
// Sprite files to read in
'src': ['public/slice/*.png'],
// Location to output spritesheet
'destImg': 'public/sprite/sprite.png',
// Stylus with variables under sprite names
'destCSS': 'public/css/sprite_positions.styl',
// OPTIONAL: Manual override for imgPath specified in CSS
'imgPath': '../sprite/sprite.png',
// OPTIONAL: Specify algorithm (top-down, left-right, diagonal [\ format],
// alt-diagonal [/ format], binary-tree [best packing])
'algorithm': 'alt-diagonal',
// OPTIONAL: Specify padding between images
'padding': 2,
// OPTIONAL: Specify engine (auto, canvas, gm)
'engine': 'gm',
// OPTIONAL: Specify CSS format (inferred from destCSS' extension by default)
// (stylus, scss, sass, less, json, css)
'cssFormat': 'css',
// OPTIONAL: Specify settings for engine
'engineOpts': {
'imagemagick': true
},
// OPTIONAL: Specify img options
'imgOpts': {
// Format of the image (inferred from destImg' extension by default) (jpg, png)
'format': 'png',
// Quality of image (gm only)
'quality': 90
},
// OPTIONAL: Specify css options
'cssOpts': {
// Some templates allow for skipping of function declarations
'functions': false
}
}
}
});
grunt.loadNpmTasks('grunt-spritesmith');
grunt.registerTask('default', ['sprite']);
}
The package.json
is this
{
"name": "ui-framework",
"version": "0.1.0",
"pkgName":"ui",
"devDependencies": {
"grunt":"*",
"grunt-spritesmith":"*"
}
}
You have
'engineOpts': {
'imagemagick': true
}
in your config. You only should put that in if you want to use imagemagick
over graphics-magick
. Since you have graphics-magick
installed, if you remove that, then you will be back to running.
A lot of the options you have entered are unnecessary (hence them being marked as OPTIONAL
). Please read the description for each and consider if you need/don't need it.
It works! It is my fault, I should have read the description more carefully. I just copy the code as the default sample code- - Thanks for helping, thank you very much.
Hi,when I run the grunt-spritesmith , I got a warning message read "Warning: Sorry, the spritesmith engine 'gm' could not be loaded. Please be sure you have installed it properly on your machine. Use --force to continue."
I am sure that I have installed PhantomJS and GM :
And this is my local grunt plugins:
The code of Gruntfile.js is copied from the usage in the Readme.md.
I don't know what could cause this issue. Could you help me and have a look?
Thank you ;-)