summaryrefslogtreecommitdiffstats
path: root/lib/utils/images.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-01-22 21:04:36 +0100
committerSamy Pessé <samypesse@gmail.com>2016-01-22 21:04:36 +0100
commit877f2e477b010f9f37a9044606f110a90f077680 (patch)
tree5cd61cf3b00ba10dc6110535ed9fdf67d8baba72 /lib/utils/images.js
parentc8e2fc0e57d223c01a51d6ee186fc1662cd74d13 (diff)
downloadgitbook-877f2e477b010f9f37a9044606f110a90f077680.zip
gitbook-877f2e477b010f9f37a9044606f110a90f077680.tar.gz
gitbook-877f2e477b010f9f37a9044606f110a90f077680.tar.bz2
Start rewrite
Diffstat (limited to 'lib/utils/images.js')
-rw-r--r--lib/utils/images.js37
1 files changed, 0 insertions, 37 deletions
diff --git a/lib/utils/images.js b/lib/utils/images.js
deleted file mode 100644
index a82b0a1..0000000
--- a/lib/utils/images.js
+++ /dev/null
@@ -1,37 +0,0 @@
-var _ = require("lodash");
-var Q = require("q");
-var fs = require("./fs");
-var spawn = require("spawn-cmd").spawn;
-
-// Convert a svg file
-var convertSVG = function(source, dest, options) {
- if (!fs.existsSync(source)) return Q.reject(new Error("File doesn't exist: "+source));
- var d = Q.defer();
-
- options = _.defaults(options || {}, {
-
- });
-
- //var command = shellescape(["svgexport", source, dest]);
- var child = spawn("svgexport", [source, dest]);
-
- child.on("error", function(error) {
- if (error.code == "ENOENT") error = new Error("Need to install \"svgexport\" using \"npm install svgexport -g\"");
- return d.reject(error);
- });
-
- child.on("close", function(code) {
- if (code === 0 && fs.existsSync(dest)) {
- d.resolve();
- } else {
- d.reject(new Error("Error converting "+source+" into "+dest));
- }
- });
-
- return d.promise;
-};
-
-module.exports = {
- convertSVG: convertSVG,
- INVALID: [".svg"]
-};