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

Add documentation showing how to save jpegs as progressive #567

Open
KMarshland opened this issue Jun 2, 2023 · 0 comments
Open

Add documentation showing how to save jpegs as progressive #567

KMarshland opened this issue Jun 2, 2023 · 0 comments

Comments

@KMarshland
Copy link

Currently, there's nothing in the documentation (at least that I can find) about saving jpegs as progressive, despite it being supported. This should be updated.

For reference, the following default directives code makes all jpgs use progressive interlacing.

defaultDirectives: (url) => {
    if (!url.searchParams.get('format') && (url.pathname.endsWith('.jpg') || url.pathname.endsWith('.jpeg'))) {
        url.searchParams.set('format', 'jpeg');
    }

    if (url.searchParams.get('format') === 'jpeg') {
        url.searchParams.set('progressive', 'true');
    }

    return url.searchParams;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant