jpeg_filter_dropon_offset
The `jpeg_filter_dropon_offset` directive specifies the vertical and horizontal offsets for overlaying an image on top of a JPEG.
Description
The jpeg_filter_dropon_offset directive is part of the NGINX JPEG filter module, which allows dynamic overlaying of images on JPEGs. This directive accepts two arguments: the first specifies the vertical offset and the second specifies the horizontal offset, both measured in pixels. By adjusting these offsets, you can precisely position the overlay image in relation to the base JPEG image being served by the NGINX server. The offsets can be positive or negative integers, impacting where the overlay will appear relative to its default position.
For example, setting jpeg_filter_dropon_offset 10 15; would position the overlay image 10 pixels down from the top of the JPEG and 15 pixels to the right of the left edge of the JPEG. If the values are set to 0 0, the overlay will be placed at the top-left corner of the JPEG by default. Using this directive in conjunction with other overlay settings such as jpeg_filter_dropon_file or jpeg_filter_dropon_memory, facilitates custom image compositing on-the-fly, enhancing the flexibility and functionality of image serving on your website.
Config Example
location /images/ {
jpeg_filter on;
jpeg_filter_dropon_offset 10 20;
jpeg_filter_dropon_file /path/to/overlay.png;
}Ensure the specified offsets do not push the overlay image outside the bounds of the original JPEG, as this may lead to unexpected visual results.
Offsets are pixel-based, so adjustments may be necessary depending on the resolution and dimensions of both the overlay and the base image.