grunt-responsive-images
Advanced tools
Comparing version 0.1.4 to 0.1.5
{ | ||
"name": "grunt-responsive-images", | ||
"description": "Produce images at different sizes for responsive websites.", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"homepage": "https://github.com/andismith/grunt-responsive-images", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -328,2 +328,10 @@ # grunt-responsive-images [](http://badge.fury.io/js/grunt-responsive-images) | ||
*0.1.5* | ||
* Test files are no longer take up disk space. | ||
* Improved error handling for isAnimated. | ||
* Fixed Travis-CI build dependencies | ||
* Files can change format | ||
* Come with me if you want to live | ||
*0.1.4* | ||
@@ -330,0 +338,0 @@ |
@@ -59,4 +59,4 @@ /** | ||
alternative: { | ||
code: 'gm', | ||
name: 'GraphicsMagick' | ||
code: 'gm', | ||
name: 'GraphicsMagick' | ||
} | ||
@@ -69,4 +69,4 @@ }, | ||
alternative: { | ||
code: 'im', | ||
name: 'ImageMagick' | ||
code: 'im', | ||
name: 'ImageMagick' | ||
} | ||
@@ -281,3 +281,3 @@ } | ||
// data.Delay and Scene can identify an animation GIF | ||
if (!tryAnimated && data.format.toUpperCase() === 'GIF' && data.Delay && data.Scene) { | ||
if (!tryAnimated && data && data.format && data.format.toUpperCase() === 'GIF' && data.Delay && data.Scene) { | ||
grunt.verbose.warn(dstPath + ' is animated - skipping'); | ||
@@ -317,2 +317,6 @@ return true; | ||
image.identify(function(err, data) { | ||
if(err){ | ||
handleImageErrors(err, sizeOptions.engine); | ||
} | ||
if (!isAnimatedGif(data, dstPath, sizeOptions.tryAnimated)) { | ||
@@ -399,3 +403,3 @@ image.size(function(error, size) { | ||
extName = path.extname(dstPath); | ||
baseName = path.basename(srcPath, extName); // filename without extension | ||
baseName = path.basename(dstPath, extName); // filename without extension | ||
@@ -463,43 +467,43 @@ if (customDest) { | ||
// Iterate over all specified file groups. | ||
task.files.forEach(function(f) { | ||
// Iterate over all specified file groups. | ||
task.files.forEach(function(f) { | ||
var srcPath = '', | ||
dstPath = ''; | ||
var srcPath = '', | ||
dstPath = ''; | ||
checkForValidTarget(f); | ||
checkForSingleSource(f); | ||
checkForValidTarget(f); | ||
checkForSingleSource(f); | ||
// create a name for our image based on name, width, height | ||
sizeOptions.name = getName({ name: sizeOptions.name, width: sizeOptions.width, height: sizeOptions.height }, options); | ||
// create a name for our image based on name, width, height | ||
sizeOptions.name = getName({ name: sizeOptions.name, width: sizeOptions.width, height: sizeOptions.height }, options); | ||
// create an output name with prefix, suffix | ||
sizeOptions.outputName = addPrefixSuffix(sizeOptions.name, sizeOptions.separator, sizeOptions.suffix, sizeOptions.rename); | ||
// create an output name with prefix, suffix | ||
sizeOptions.outputName = addPrefixSuffix(sizeOptions.name, sizeOptions.separator, sizeOptions.suffix, sizeOptions.rename); | ||
srcPath = f.src[0]; | ||
dstPath = getDestination(srcPath, f.dest, sizeOptions, f.custom_dest, f.orig.cwd); | ||
srcPath = f.src[0]; | ||
dstPath = getDestination(srcPath, f.dest, sizeOptions, f.custom_dest, f.orig.cwd); | ||
// remove pixels from the value so the gfx process doesn't complain | ||
sizeOptions = removeCharsFromObjectValue(sizeOptions, ['width', 'height'], 'px'); | ||
// remove pixels from the value so the gfx process doesn't complain | ||
sizeOptions = removeCharsFromObjectValue(sizeOptions, ['width', 'height'], 'px'); | ||
series.push(function(callback) { | ||
series.push(function(callback) { | ||
if (sizeOptions.newFilesOnly) { | ||
if (isFileNewVersion(srcPath, dstPath)) { | ||
if (sizeOptions.newFilesOnly) { | ||
if (isFileNewVersion(srcPath, dstPath)) { | ||
return processImage(srcPath, dstPath, sizeOptions, tally, callback); | ||
} else { | ||
grunt.verbose.ok('File already exists: ' + dstPath); | ||
return callback(); | ||
} | ||
} else { | ||
return processImage(srcPath, dstPath, sizeOptions, tally, callback); | ||
} else { | ||
grunt.verbose.ok('File already exists: ' + dstPath); | ||
return callback(); | ||
} | ||
} else { | ||
return processImage(srcPath, dstPath, sizeOptions, tally, callback); | ||
} | ||
}); | ||
}); | ||
}); | ||
series.push(function(callback) { | ||
outputResult(tally[sizeOptions.id], sizeOptions.name); | ||
return callback(); | ||
}); | ||
series.push(function(callback) { | ||
outputResult(tally[sizeOptions.id], sizeOptions.name); | ||
return callback(); | ||
}); | ||
} | ||
@@ -506,0 +510,0 @@ }); |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
415
13832447
68
840
1