Skip to content

Commit 49eb49c

Browse files
committed
fix: optimize check for meta height, prepare release
1 parent 7a79c19 commit 49eb49c

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

CHANGELOG_de-DE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.0.18
2+
3+
* Behebe Fehler bei Bildern ohne Maße
4+
15
# 1.0.17
26

37
* Code bereinigt

CHANGELOG_en-GB.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.0.18
2+
3+
* Fix error with images without dimensions
4+
15
# 1.0.17
26

37
* Cleanup code

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"thumbnail"
1212
],
1313
"description": "This plugins allows you to use variable thumbnails, without having them on storage.",
14-
"version": "1.0.17",
14+
"version": "1.0.18",
1515
"type": "shopware-platform-plugin",
1616
"license": "mit",
1717
"authors": [

src/Resources/views/storefront/utilities/thumbnail.html.twig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
{% endif %}
2020

2121
{% set metaProportion = media.metaData %}
22-
{% if metaProportion > 0 %}
23-
{% set ratio = (metaProportion.width / metaProportion.height)|round(2, 'floor') %}
24-
{% endif %}
22+
{% set ratio = (metaProportion.width / max(metaProportion.height, 1))|round(2, 'floor') %}
2523

2624
{% if layout == 'full-width' %}
2725
{% if ratio >= 1 %}

0 commit comments

Comments
 (0)