diff options
Diffstat (limited to 'lib/private/Preview/ProviderV1Adapter.php')
-rw-r--r-- | lib/private/Preview/ProviderV1Adapter.php | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/lib/private/Preview/ProviderV1Adapter.php b/lib/private/Preview/ProviderV1Adapter.php index f09b0f47583..ba8826ef765 100644 --- a/lib/private/Preview/ProviderV1Adapter.php +++ b/lib/private/Preview/ProviderV1Adapter.php @@ -3,28 +3,9 @@ declare(strict_types=1); /** - * @copyright Copyright (c) 2019 Robin Appelman <robin@icewind.nl> - * - * @author Julius Härtl <jus@bitgrid.net> - * @author Robin Appelman <robin@icewind.nl> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * + * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ - namespace OC\Preview; use OC\Files\View; @@ -50,13 +31,13 @@ class ProviderV1Adapter implements IProviderV2 { } public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage { - list($view, $path) = $this->getViewAndPath($file); + [$view, $path] = $this->getViewAndPath($file); $thumbnail = $this->providerV1->getThumbnail($path, $maxX, $maxY, false, $view); return $thumbnail === false ? null: $thumbnail; } private function getViewAndPath(File $file) { - $view = new View($file->getParent()->getPath()); + $view = new View(dirname($file->getPath())); $path = $file->getName(); return [$view, $path]; |