Skip to content
Merged
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
13 changes: 9 additions & 4 deletions lib/private/Preview/Movie.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,15 @@ public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage {

$result = null;
if ($this->useTempFile($file)) {
// try downloading 5 MB first as it's likely that the first frames are present there
// in some cases this doesn't work for example when the moov atom is at the
// end of the file, so if it fails we fall back to getting the full file
$sizeAttempts = [5242880, null];
// Try downloading 5 MB first, as it's likely that the first frames are present there.
// In some cases this doesn't work, for example when the moov atom is at the
// end of the file, so if it fails we fall back to getting the full file.
// Unless the file is not local (e.g. S3) as we do not want to download the whole (e.g. 37Gb) file
if ($file->getStorage()->isLocal()) {
$sizeAttempts = [5242880, null];
} else {
$sizeAttempts = [5242880];
}
} else {
// size is irrelevant, only attempt once
$sizeAttempts = [null];
Expand Down
Loading