Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Files: tests/data/integritycheck/htaccessWithValidModifiedContent/.htaccess
Copyright: 2016 ownCloud, Inc., 2019 Nextcloud GmbH and Nextcloud contributors
License: AGPL-3.0-only

Files: core/img/favicon*.* core/img/logo/logo*.* tests/data/testimage.webp apps/testing/img/logo.png core/img/apps/spreed.svg
Files: core/img/favicon*.* core/img/logo/logo*.* tests/data/testimage.webp tests/data/broken-video.webm apps/testing/img/logo.png core/img/apps/spreed.svg
Copyright: 2016-2024 Nextcloud GmbH
License: LicenseRef-NextcloudTrademarks

Expand Down
2 changes: 1 addition & 1 deletion lib/private/Preview/Movie.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ private function generateThumbNail(int $maxX, int $maxY, string $absPath, int $s
$returnCode = -1;
$output = '';
if (is_resource($proc)) {
$stdout = trim(stream_get_contents($pipes[1]));
$stderr = trim(stream_get_contents($pipes[2]));
$stdout = trim(stream_get_contents($pipes[1]));
$returnCode = proc_close($proc);
$output = $stdout . $stderr;
}
Expand Down
Binary file added tests/data/broken-video.webm
Binary file not shown.
20 changes: 20 additions & 0 deletions tests/lib/Preview/MovieBrokenStuckFfmpegTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace Test\Preview;

/**
* Class MovieTest
*
* @group DB
*
* @package Test\Preview
*/
class MovieBrokenStuckFfmpegTest extends MovieTest {
protected string $fileName = 'broken-video.webm';
}
9 changes: 5 additions & 4 deletions tests/lib/Preview/MovieTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
* @package Test\Preview
*/
class MovieTest extends Provider {
protected string $fileName = 'testimage.mp4';
protected int $width = 560;
protected int $height = 320;

protected function setUp(): void {
$avconvBinary = \OC_Helper::findBinaryPath('avconv');
$ffmpegBinary = ($avconvBinary) ? null : \OC_Helper::findBinaryPath('ffmpeg');
Expand All @@ -25,10 +29,7 @@ protected function setUp(): void {
\OC\Preview\Movie::$avconvBinary = $avconvBinary;
\OC\Preview\Movie::$ffmpegBinary = $ffmpegBinary;

$fileName = 'testimage.mp4';
$this->imgPath = $this->prepareTestFile($fileName, \OC::$SERVERROOT . '/tests/data/' . $fileName);
$this->width = 560;
$this->height = 320;
$this->imgPath = $this->prepareTestFile($this->fileName, \OC::$SERVERROOT . '/tests/data/' . $this->fileName);
$this->provider = new \OC\Preview\Movie;
} else {
$this->markTestSkipped('No Movie provider present');
Expand Down
Loading