Created
May 10, 2013 21:18
-
-
Save rotespferd/5557493 to your computer and use it in GitHub Desktop.
Converts all images in a directory from .xcf to .png.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/node | |
var fs = require('fs'); | |
var sys = require('sys'); | |
var exec = require('child_process').exec; | |
console.log("Start converting"); | |
var command = "convert -flatten "; | |
fs.readdir(".", function (err, files) { | |
for(var i in files) { | |
var convCommand = command + files[i] + " " + files[i].split(".")[0] + ".png"; | |
console.log(convCommand); | |
function puts(error, stdout, stderr) { sys.puts(stdout) }; | |
exec(convCommand, puts); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment