Skip to content
Closed
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
5 changes: 5 additions & 0 deletions lib/private/Preview/Bundled.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
*/
abstract class Bundled extends ProviderV2 {
protected function extractThumbnail(File $file, $path): ?IImage {

if ($file->getSize() === 0) {
return null;
}

$sourceTmp = \OC::$server->getTempManager()->getTemporaryFile();
$targetTmp = \OC::$server->getTempManager()->getTemporaryFile();

Expand Down
2 changes: 1 addition & 1 deletion lib/private/Preview/OpenDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function getMimeType(): string {
*/
public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage {
$image = $this->extractThumbnail($file, 'Thumbnails/thumbnail.png');
if ($image->valid()) {
if (!empty($image) && $image->valid()) {
return $image;
}
return null;
Expand Down