{# Hero Image ========== #} {# Setup for Hero Image #} {% if data.hero | length %} {% set photo = data.hero.photo.first() %} {# If Image is available build the block #} {% if photo|length %} {% set focusPosition = photo.focalpoint is defined ? photo.focalpoint : '50% 50%' %} {# Setup Landscape #} {% set landscape = craft.imager.transformImage(photo, [ { width: 1920 }, { width: 1480 }, { width: 1200 }, { width: 800 }, { width: 600 } ], { jpegQuality: 86, ratio: 16/10, mode: 'crop', position: focusPosition }) %} {# Generate the Portrait Set #} {% set portrait = craft.imager.transformImage(photo, [ { width: 600 }, { width: 520 }, { width: 420 }, { width: 320 } ], { jpegQuality: 83, ratio: 9/16, mode: 'crop', position: focusPosition }) %}