Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
var path = require('path');
var fs = require('fs');
var crypto = require('crypto');
var isWin = /^win/.test(process.platform); //Temporary workaround for https://github.com/ariya/phantomjs/issues/14194

var postcss = require('postcss');
var async = require('async');
var when = require('when');
var phantomjs = require('phantomjs');
var phantomjs = require('phantomjs-prebuilt');
var childProcess = require('child_process');

var phantomjsScript = path.resolve(__dirname, './phantomjs-script.js');
Expand Down Expand Up @@ -132,12 +133,13 @@ module.exports = postcss.plugin('postcss-svg-fallback', function(options) {
});

function processImage(options, image, cb) {
var source = path.join(options.basePath || '', image.image);
var source = path.resolve(path.join(options.basePath || '', image.image));
var sourceUrl = isWin ? 'file:///' + source : source;
var dest = path.join(options.dest || '', image.newImage);

var args = [
phantomjsScript,
image.inline ? image.image : source,
image.inline ? image.image : sourceUrl,
image.size.width,
image.size.height,
dest,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": "index.js",
"dependencies": {
"postcss": "~4.1.9",
"phantomjs": "~1.9.16",
"phantomjs-prebuilt": "~2.1.7",
"async": "~0.9.0",
"when": "~3.7.3"
},
Expand Down
Binary file modified test/images/expected-800f6893213eec77f13405f4a806b6c1-20x20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/images/expected-email-20x20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.