Skip to content

Commit

Permalink
fix: increase the calculated ratio to three digits
Browse files Browse the repository at this point in the history
  • Loading branch information
tinect committed Nov 4, 2021
1 parent 1a5ed7f commit 9959647
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG_de-DE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Gebe alt- und title-Attribute bei Thumbnails aus, wenn diese beim Bild gespeichert wurden
* Entferne Nutzung von Höhe bei den Thumbnailgrößen, da die automatische Berechnung der notwendigen Größe darauf keinen direkten Bezug nimmt
* Bitte entfernen Sie die Höhe aus Ihrem Template in den Plugin-Einstellungen
* Erhöhe berechnete Ratio auf drei Stellen

# 1.0.19

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG_en-GB.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Output alt and title attributes for thumbnails if they were saved with the image in media
* Remove the use of height from the thumbnail sizes, as the automatic calculation of the necessary size does not make any direct reference to it
* Please remove the height from your template in the plugin settings
* Increase the calculated ratio to three digits

# 1.0.19

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{{ media|sw_encode_media_url }} {{ thumbnails|first.width + 1 }}w, {% for thumbnail in thumbnails %}{{ thumbnail.url | sw_encode_url }} {{ thumbnail.width }}w{% if not loop.last %}, {% endif %}{% endfor %}
{% endapply %}{% endset %}
{% endif %}
{% set ratio = (metaProportion.width / max(metaProportion.height, 1))|round(2, 'floor') %}
{% set ratio = (metaProportion.width / max(metaProportion.height, 1))|round(3, 'floor') %}

{% if fullWidth %}
{% if ratio >= 1 %}
Expand Down

0 comments on commit 9959647

Please sign in to comment.