26 # Important or height handling is wrong.
27 if ( !$this->normaliseParams( $file,
$params ) ) {
31 $srcWidth = $file->getWidth();
32 $srcHeight = $file->getHeight();
35 if ( $this->isAudio( $file ) ) {
43 $targetWidth =
$params[
'width'];
44 $targetHeight = $srcWidth == 0 ? $srcHeight : round(
$params[
'width'] * $srcHeight / $srcWidth );
45 if ( isset(
$params[
'height'] ) && $targetHeight >
$params[
'height'] ) {
46 $targetHeight =
$params[
'height'];
47 $targetWidth = round(
$params[
'height'] * $srcWidth / $srcHeight );
52 'offset' => $this->getOffset( $file ),
53 'width' => $targetWidth,
54 'height' => $targetHeight,
55 'isVideo' => !$this->isAudio( $file ),
58 ) ?
$params[
'thumbtime'] : intval( $file->getLength() / 2 ),
61 'fillwindow' => isset(
$params[
'fillwindow'] ) ?
$params[
'fillwindow'] :
false,
62 'disablecontrols' => isset (
$params[
'disablecontrols'] ) ?
$params[
'disablecontrols'] :
false
67 return new TimedMediaTransformOutput(
$options );
75 return new TimedMediaTransformOutput(
$options );