Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: create previews from first page on multi-page documents
- Loading branch information
1 parent
b3902c9
commit 21f2d28
Showing
7 changed files
with
66 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Bugfix: create previews from first page | ||
|
||
On multi-page documents (doc, odt, pdf etc) the preview will now be generated | ||
from the first page and no longer from the last page. | ||
|
||
https://github.com/owncloud/core/pull/41045 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
/** | ||
* @author Olivier Paroz <owncloud@interfasys.ch> | ||
* | ||
* @copyright Copyright (c) 2018, ownCloud GmbH | ||
* @license AGPL-3.0 | ||
* | ||
* This code is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License, version 3, | ||
* as published by the Free Software Foundation. | ||
* | ||
* 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, version 3, | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* | ||
*/ | ||
|
||
namespace lib\Preview; | ||
|
||
use OC\Preview\PDF; | ||
use OCP\Files\NotFoundException; | ||
use Test\Preview\Provider; | ||
|
||
/** | ||
* Class SVGTest | ||
* | ||
* @group DB | ||
* | ||
* @package Test\Preview | ||
*/ | ||
class PDFTest extends Provider { | ||
/** | ||
* @throws NotFoundException | ||
*/ | ||
public function setUp(): void { | ||
if (\count(\Imagick::queryFormats('SVG')) === 1) { | ||
parent::setUp(); | ||
|
||
$fileName = 'testimage.pdf'; | ||
$this->imgPath = $this->prepareTestFile($fileName, \OC::$SERVERROOT . '/tests/data/' . $fileName); | ||
$this->width = 595; | ||
$this->height = 842; | ||
$this->provider = new PDF(); | ||
} else { | ||
$this->markTestSkipped('No PDF provider present'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters