Overlay align

      Last updated May 18, 2020

    The overlay-align parameter sets the position of the overlay relative to the image.

    API Pattern

    Parameter

    Parameter Description
    overlay-align The position of the overlay relative to the image.

    Parameter Values

    Value Description
    top Align the overlay to the top.
    bottom Align the overlay to the bottom.
    left Align the overlay to the left.
    right Align the overlay to the right.
    middle Align the overlay to the middle vertically.
    center Align the overlay to the center horizontally.

    Notes

    1. By default the overlay is positioned: middle, center

    Examples

    Align the overlay to the top

    1
    2
    3
    4
    5
    6
    7
    
    sub vcl_recv {
      #FASTLY recv
        if (req.url.qs ~ "overlay") {
          set req.http.X-fastly-imageopto-overlay = "overlay=/img/overlay.png&overlay-align=top";
        }
      return(lookup);
     }
    

    Align the overlay to the bottom right

    1
    2
    3
    4
    5
    6
    7
    
    sub vcl_recv {
      #FASTLY recv
        if (req.url.qs ~ "overlay") {
          set req.http.X-fastly-imageopto-overlay = "overlay=/img/overlay.png&overlay-align=bottom,right";
        }
      return(lookup);
     }
    
    Back to Top