User-selected Image Transform
landscapeMd and portraitMd are variables... they would need to be strings (or array keys) for this to work.

Try something like this:

{# medium 16:9 #}
{% set landscapeMd = {
  width: 439,
  height: 247,
  quality: 80,
} %}

{# medium 9:16 #}
{% set portraitMd = {
  width: 278,
  height: 494,
  quality: 80,
} %}

{% set transforms = {
  'landscapeMd': landscapeMd,
  'portraitMd': portraitMd
} %}

{% for block in entry.productCollage %}
  {% switch block.type %}
    {% case "digitalProduct" %}
      // selected via dropdown field
      {% set transformType = transforms[block.imageAspectRatio.value] %}

      &lt;figure&gt;
        {% for image in block.image %}
          &lt;a href=""&gt;&lt;img src="{{ image.url(transformType) }}" alt=""&gt;&lt;/a&gt;
        {% endfor %}
      &lt;/figure&gt;
  {% endswitch %}
{% endfor %}


This maps the transforms with the transforms object, then references the key in transforms[block.imageAspectRatio.value].