sharp
sharp copied to clipboard
Introduce `whenJpeg` (and similar for PNG etc) as alternative to `force: false`
As discussed here: https://github.com/lovell/sharp/issues/659
This naming could make it clearer that it only applies to JPGs.
The proposed syntax would be:
pipeline.resize(100,100).whenJpeg({quality : 75}).toBuffer(function(){})
Which would do the same as:
pipeline.resize(100,100).jpeg({quality : 75, force : false}).toBuffer(function(){})
Alternative function names could be ifJpeg or jpegOptions.
I don't know this lib well enough to know whether force: false should be deprecated/removed or not.