Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to allow converting to JPEG from non-JPEG input formats #7

Closed
niieani opened this issue Dec 5, 2015 · 3 comments
Closed

Option to allow converting to JPEG from non-JPEG input formats #7

niieani opened this issue Dec 5, 2015 · 3 comments

Comments

@niieani
Copy link

niieani commented Dec 5, 2015

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.

@sindresorhus
Copy link
Contributor

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

@tomasklaen
Copy link

tomasklaen commented Sep 4, 2021

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?

@niieani
Copy link
Author

niieani commented Sep 4, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants