Option to allow converting to JPEG from non-JPEG input formats
niieani opened this issue · comments
Currently all non-jpeg images are filtered out by:
if (!isJpg(file.contents)) {
cb(null, file);
return;
}
However, mozjpeg binary supports other input formats, such as PNG.
It would be great to have a convert option that does not filter other image formats.
Out of scope for this plugin. Imagemin is about minifying images. You can just use the underlying binary directly: https://github.com/imagemin/mozjpeg-bin
Is this still out of scope? Because imagemin-webp
accepts jpg and png no problem.
Would it be too much to allow each plugin to accept whatever the binary accepts already, and document it in readme?
Yes, that was my original point, perhaps I wasn't clear. I didn't mean we should add some new layer to convert files prior to passing them through to mozjpeg
, just to relax the guard and support all the image formats that mozjpeg
already supports today.