if (!is_null($w) && !is_null($h)) {
$attr['width'] = $w;
$attr['height'] = $h;
- } else if (!is_null($compiler) && CubeIT_Util_Url::isLocal($data->to)) {
+ }
+
+ if (!is_null($compiler)) {
// Get video dimensions from thumbnail if possible (locally uploaded files)
- $path = $compiler->wdir . '/' . $data->to;
+ if (CubeIT_Util_Url::isLocal($data->to)) {
+ $path = $compiler->wdir . '/' . $data->to;
+ } else {
+ $path = $data->to;
+ }
$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];
+ if (isset($e[0]) && is_numeric($e[0])) {
+ $attr['width'] = $e[0];
+ $attr['height'] = $e[1];
+ }
}
return $attr;