From d02f8f5a017d3853914d9931308dea0bafb677f2 Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Fri, 12 Jul 2019 18:06:01 +0400 Subject: [PATCH] PHRAS-2665 #comment Fix video tool ratio #time 8h --- cache/.gitkeep | 0 .../prod/actions/Tools/videoEditor.html.twig | 36 +++++++++++++++---- 2 files changed, 29 insertions(+), 7 deletions(-) delete mode 100644 cache/.gitkeep diff --git a/cache/.gitkeep b/cache/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/templates/web/prod/actions/Tools/videoEditor.html.twig b/templates/web/prod/actions/Tools/videoEditor.html.twig index df8f61332c..c4f45e1642 100644 --- a/templates/web/prod/actions/Tools/videoEditor.html.twig +++ b/templates/web/prod/actions/Tools/videoEditor.html.twig @@ -45,6 +45,8 @@ {% set dataH = constant('media_subdef::TC_DATA_HEIGHT') %} {% set technical_info = record.get_technical_infos %} + + {#Set the preview Ratio #} {% set width = technical_info[dataW].value %} {% set height = technical_info[dataH].value %} @@ -56,12 +58,32 @@ {% set ratio = '' %} {% endif %} - + {#Set the document Ratio #} + {% for subdef in outputFormats %} + + {% set width = subdef.get_width() %} + {% set height = subdef.get_height() %} + + {% if width and height %} + {% set rawRatio = (width / height)|number_format(3, '.') %} + {% set rawRatioLength = rawRatio|length %} + {% set docRatio = rawRatio|slice(0,rawRatioLength-1) %} + {% else %} + {% set docRatio = '' %} + {% endif %} + + + +
+ {% endfor %}
@@ -109,7 +131,7 @@ + class="alt_canvas" id="{{ subdef.get_name() }}" > {% endfor %}