Add chroma subsampling options for JPEG output

This commit is contained in:
Lovell Fuller
2015-02-13 09:41:42 +00:00
parent 0e91ca90d6
commit 1f7e80e581
7 changed files with 69 additions and 5 deletions

View File

@@ -12,7 +12,7 @@
"imagemagick-native": "^1.7.0",
"gm": "^1.17.0",
"async": "^0.9.0",
"semver": "^4.2.0",
"semver": "^4.3.0",
"benchmark": "^1.0.0"
},
"license": "Apache 2.0",

View File

@@ -347,6 +347,18 @@ async.series({
}
});
}
}).add('sharp-without-chroma-subsampling', {
defer: true,
fn: function(deferred) {
sharp(inputJpgBuffer).resize(width, height).withoutChromaSubsampling().toBuffer(function(err, buffer) {
if (err) {
throw err;
} else {
assert.notStrictEqual(null, buffer);
deferred.resolve();
}
});
}
}).add('sharp-rotate', {
defer: true,
fn: function(deferred) {