jpeg_filter_dropon_align

The `jpeg_filter_dropon_align` directive specifies the alignment of an overlay image on a JPEG, determining its placement based on given vertical and horizontal alignment options.

Syntaxjpeg_filter_dropon_align vertical horizontal;
Defaultcenter center
Contextlocation
Arguments2

Description

The jpeg_filter_dropon_align directive is used within the context of JPEG image processing to control where an overlay image is placed relative to the base JPEG image during the filtering process. This directive takes two parameters: the first parameter specifies the vertical alignment (options are top, center, bottom), and the second parameter defines the horizontal alignment (options are left, center, right). This configuration allows for precise placement of overlay elements, such as logos or watermarks, on the target JPEG image.

By default, both vertical and horizontal alignments are set to center, which places the overlay image right in the middle of the JPEG. When different alignment options are selected, the overlay is adjusted accordingly, helping users customize the appearance of images dynamically without the need to modify the original files. This feature is particularly useful for web applications that require dynamic image manipulations based on user input or preferences.

Config Example

location /images/ {
    jpeg_filter on;
    jpeg_filter_dropon_align bottom right;
    jpeg_filter_dropon_file /path/to/logo.png;
}

Ensure that the overlay image is properly sized to avoid unexpected results.

Using options outside of top, center, bottom, left, right will result in errors.

Incorrect paths to overlay images can cause the JPEG processing to fail.

← Back to all directives