mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 10:23:17 +00:00
Remove ratio = 1 as default
This commit is contained in:
@@ -131,9 +131,9 @@
|
||||
{% set height = record.get_technical_infos(dataH) %}
|
||||
|
||||
{% if width and height %}
|
||||
{% set ratio = (width / height) %}
|
||||
{% set ratio = width / height %}
|
||||
{% else %}
|
||||
{% set ratio = 1 %}
|
||||
{% set ratio = '' %}
|
||||
{% endif %}
|
||||
|
||||
<video id="thumb_video" controls="" preload="auto" data-ratio="{{ ratio }}">
|
||||
|
||||
@@ -13,13 +13,16 @@
|
||||
var w = elementDomNode.getWidth();
|
||||
var maxH = elementDomNode.getHeight();
|
||||
|
||||
if ('' !== elementDomNode.getAspectRatio()) {
|
||||
var h = Math.round(w * (1 / elementDomNode.getAspectRatio()));
|
||||
|
||||
if (h > maxH) {
|
||||
var h = maxH;
|
||||
var w = Math.round(h * elementDomNode.getAspectRatio());
|
||||
}
|
||||
|
||||
} else {
|
||||
var h = maxH;
|
||||
}
|
||||
|
||||
this.domCanva.setAttribute("width", w);
|
||||
this.domCanva.setAttribute("height", h);
|
||||
@@ -102,7 +105,7 @@
|
||||
|
||||
var Video = function(domElement){
|
||||
Image.call(this, domElement);
|
||||
this.aspectRatio = domElement.getAttribute('data-ratio') || 1;
|
||||
this.aspectRatio = domElement.getAttribute('data-ratio');
|
||||
};
|
||||
|
||||
Video.prototype = new Image();
|
||||
|
||||
Reference in New Issue
Block a user