jpeg_filter_progressive
The `jpeg_filter_progressive` directive enables progressive JPEG encoding in the NGINX JPEG filter module.
Description
The jpeg_filter_progressive directive controls whether images processed by the NGINX JPEG filter module should be encoded as progressive JPEGs, which are designed to display a low-quality version of an image quickly and gradually improve its quality as more data is downloaded. When this directive is set to on, it instructs the underlying library, libmodjpeg, to encode JPEG images progressively, enhancing the user experience during image loading by allowing for a more visually appealing initial render.
This directive is often used in conjunction with the jpeg_filter directive, which must be enabled for any filtering operations to take place. When jpeg_filter_progressive is activated, the resulting JPEG will contain multiple scans, allowing the client to display a lower resolution image before the full quality is available. This is especially useful for large images where users may prefer to see something almost immediately rather than waiting for the entire file to download. The parameter accepts a simple boolean flag: on or off. The default behavior, if not explicitly specified, is off, meaning JPEGs will be stored in the standard sequential format unless this directive is enabled.
Config Example
location /images {
jpeg_filter on;
jpeg_filter_progressive on;
}Ensure the jpeg_filter directive is enabled; otherwise, jpeg_filter_progressive will have no effect.
Not all image viewers fully support progressive JPEGs, leading to potential display issues in some cases.