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;