grunt-responsive-images
Advanced tools
Comparing version 0.1.6 to 0.1.7
{ | ||
"name": "grunt-responsive-images", | ||
"description": "Produce images at different sizes for responsive websites.", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"homepage": "https://github.com/andismith/grunt-responsive-images", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -179,2 +179,14 @@ # grunt-responsive-images [](http://badge.fury.io/js/grunt-responsive-images) | ||
* **sharpen**<br /> | ||
*Type:* `Object`<br /> | ||
*Default:* `null`<br /> | ||
*Version:* 0.1.7 and above | ||
Sharpen allows you to pass an object with 'sigma' and 'radius' options. The most important factor is the sigma. As it is the real control of the sharpening operation. Sigma can be any floating point value from .1 for practically no sharpening to 3 or more for sever sharpening. 0.5 to 1.0 work well. Radius is the limit of the effect as is the threshold. Radius is only in integer units as that is the way the algorithm works, the larger it is the slower it is. But it should be at a minimum 1 or better still 2 times the sigma. For example: | ||
sharpen: { | ||
sigma: 1, | ||
radius: 2 | ||
} | ||
* **filter**<br /> | ||
@@ -190,3 +202,3 @@ *Type:* `String`<br /> | ||
*Type:* `Boolean`<br /> | ||
*Default:* false.`<br /> | ||
*Default:* `false`<br /> | ||
*Available Values:* `true` || `false`<br /> | ||
@@ -352,2 +364,12 @@ *Version:* 0.1.6 and above. | ||
*0.1.7* | ||
* Speed increase of up to five times faster. | ||
* Added 'sharpen' option | ||
* Where we're going, we don't need roads. | ||
*0.1.6* | ||
* Added 'sample' option | ||
*0.1.5* | ||
@@ -354,0 +376,0 @@ |
@@ -37,2 +37,3 @@ /** | ||
customOut: null, | ||
sharpen: null, | ||
sizes: [{ | ||
@@ -317,3 +318,3 @@ name: 'small', | ||
image.identify(function(err, data) { | ||
image.identify("%m:%T:%s\n", function(err, dataRaw) { | ||
if(err){ | ||
@@ -323,2 +324,13 @@ handleImageErrors(err, sizeOptions.engine); | ||
var lastLineData = dataRaw.trim().split("\n").slice(-1)[0].split(":"); | ||
if (lastLineData.length !== 3) { | ||
handleImageErrors(new Error("Could not parse identify output: " + dataRaw), sizeOptions.engine); | ||
} | ||
var data = { | ||
format: lastLineData[0], | ||
Delay: parseInt(lastLineData[1], 10), | ||
Scene: parseInt(lastLineData[2], 10) | ||
}; | ||
if (!isAnimatedGif(data, dstPath, sizeOptions.tryAnimated)) { | ||
@@ -382,2 +394,7 @@ image.size(function(error, size) { | ||
if (sizeOptions.sharpen) { | ||
image | ||
.sharpen(sizeOptions.sharpen.radius, sizeOptions.sharpen.sigma); | ||
} | ||
image.write(dstPath, function (error) { | ||
@@ -384,0 +401,0 @@ if (error) { |
46070
869
459