Skip to content

Commit

Permalink
Disable PDF previews as algorithm is no reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
bladeroot authored and SilverFire committed Mar 1, 2019
1 parent 1662f92 commit ead4510
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/widgets/filePreview/FilePreviewFactory.php
Expand Up @@ -23,7 +23,7 @@ class FilePreviewFactory implements FilePreviewFactoryInterface
{
public $generators = [
'^image/.*$' => ImagePreviewGenerator::class,
'^application/pdf$' => PdfPreviewGenerator::class,
// '^application/pdf$' => PdfPreviewGenerator::class,
];

/**
Expand Down
3 changes: 3 additions & 0 deletions src/widgets/filePreview/types/PdfPreviewGenerator.php
Expand Up @@ -27,6 +27,9 @@ protected function getImagick()
{
if ($this->imagick === null) {
$this->imagick = new Imagick(realpath($this->path) . '[0]');
$this->imagick->setResolution(600, 600);
$this->imagick->setCompressionQuality(95);
$this->imagick->setImageFormat('jpeg');
}

return $this->imagick;
Expand Down

0 comments on commit ead4510

Please sign in to comment.