mirror of
https://github.com/nextcloud/server.git
synced 2024-08-18 02:10:32 +02:00
MP3 without cover don't get a preview
* Fixes #2739 It tries to create an image from an SVG file. Which we don't support. So this fails and prints an log line. Then we fall back anyways to the 404 and fetch the default icon. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
c38f87e799
commit
53640bbc47
@ -61,24 +61,6 @@ class MP3 extends Provider {
|
||||
}
|
||||
}
|
||||
|
||||
return $this->getNoCoverThumbnail();
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a default image when the file has no cover
|
||||
*
|
||||
* @return bool|\OCP\IImage false if the default image is missing or invalid
|
||||
*/
|
||||
private function getNoCoverThumbnail() {
|
||||
$icon = \OC::$SERVERROOT . '/core/img/filetypes/audio.svg';
|
||||
|
||||
if(!file_exists($icon)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$image = new \OC_Image();
|
||||
$image->loadFromFile($icon);
|
||||
return $image->valid() ? $image : false;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user