From 8a27e96404f1f41e19efddafa7010a548e3f1295 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Fri, 7 Feb 2020 14:03:55 +0000 Subject: [PATCH] wip #3399 @0.5 --- inc/ws/Util/html5/master/class.ws.html5.links.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/inc/ws/Util/html5/master/class.ws.html5.links.php b/inc/ws/Util/html5/master/class.ws.html5.links.php index 53471c546..9cd8f6782 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -866,13 +866,16 @@ class videoLink extends wsHTML5Link if (!is_null($w) && !is_null($h)) { $attr['width'] = $w; $attr['height'] = $h; - } else if (!is_null($compiler)) { // Get video dimensions from thumbnail if possible (locally uploaded files) - $path = WS_BOOKS . '/working/' . $compiler->book_id . '/' . $basename . '.jpg'; - $dim = getimagesize($path); - $attr['width'] = $dim[0]; - $attr['height'] = $dim[1]; +// $path = WS_BOOKS . '/working/' . $compiler->book_id . '/' . $basename . '.jpg'; +// $dim = getimagesize($path); +// $attr['width'] = $dim[0]; +// $attr['height'] = $dim[1]; + $path = WS_BOOKS . '/working/' . $compiler->book_id . '/' . $file; + $e = explode(',', `ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 $path`); + $attr['width'] = $e[0]; + $attr['height'] = $e[1]; } return $attr; -- 2.39.5