|
13 | 13 | {%- endmacro -%} |
14 | 14 |
|
15 | 15 | {%- macro fit(src, width, height, attr, picture_attr = {}) -%} |
16 | | - {# add support of ChamberOrchestra\FileBundle\Model\File #} |
17 | | - {%- set src = src.uri|default(src) -%} |
| 16 | + {# add support of ChamberOrchestra\FileBundle\Model\File — use relativePath for image filters, falls back to uri #} |
| 17 | + {%- set src = src.relativePath|default(src.uri|default(src)) -%} |
18 | 18 | {%- set attr = attr|default({})|merge({width: attr.width|default(width), height: attr.height|default(height), style: 'height: auto', loading: 'lazy', decoding: 'async'}) -%} |
19 | 19 | <picture {{ _self.attributes(picture_attr) -}}> |
20 | 20 | <source {# |
|
36 | 36 | {%- endmacro -%} |
37 | 37 |
|
38 | 38 | {%- macro fill(src, width, height, attr, picture_attr = {}) -%} |
39 | | - {# add support of ChamberOrchestra\FileBundle\Model\File #} |
40 | | - {%- set src = src.uri|default(src) -%} |
| 39 | + {# add support of ChamberOrchestra\FileBundle\Model\File — use relativePath for image filters, falls back to uri #} |
| 40 | + {%- set src = src.relativePath|default(src.uri|default(src)) -%} |
41 | 41 | {%- set attr = attr|default({})|merge({width: attr.width|default(width), height: attr.height|default(height), style: 'height: auto', loading: 'lazy', decoding: 'async'}) -%} |
42 | 42 |
|
43 | 43 | <picture {{ _self.attributes(picture_attr) -}}> |
|
61 | 61 |
|
62 | 62 | {%- macro css_fit(src, width, height, use2x = true) -%} |
63 | 63 |
|
64 | | - {# add support of ChamberOrchestra\FileBundle\Model\File #} |
65 | | - {%- set src = src.uri|default(src) -%} |
| 64 | + {# add support of ChamberOrchestra\FileBundle\Model\File — use relativePath for image filters, falls back to uri #} |
| 65 | + {%- set src = src.relativePath|default(src.uri|default(src)) -%} |
66 | 66 | {%- set url = (src|default('')|fit(width, height)) -%} |
67 | 67 | {%- set webp = (src|default('')|fit(width, height, {output: {format: 'webp'}})) -%} |
68 | 68 | {%- set avif = (src|default('')|fit(width, height, {output: {format: 'avif'}})) -%} |
|
104 | 104 |
|
105 | 105 | {%- macro css_fill(src, width, height, use2x = true) -%} |
106 | 106 |
|
107 | | - {# add support of ChamberOrchestra\FileBundle\Model\File #} |
108 | | - {%- set src = src.uri|default(src) -%} |
| 107 | + {# add support of ChamberOrchestra\FileBundle\Model\File — use relativePath for image filters, falls back to uri #} |
| 108 | + {%- set src = src.relativePath|default(src.uri|default(src)) -%} |
109 | 109 |
|
110 | 110 | {%- set url = (src|default('')|fill(width, height)) -%} |
111 | 111 | {%- set webp = (src|default('')|fill(width, height, {output: {format: 'webp'}})) -%} |
|
0 commit comments