Add exception when PDF cannot be converted to image
This commit is contained in:
parent
f7e7e46c02
commit
9ed63828db
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Aweos\Resizer\Compressors;
|
||||
|
||||
use Aweos\Resizer\Exceptions\ResizerException;
|
||||
use Illuminate\Support\Collection;
|
||||
use Intervention\Image\ImageManager;
|
||||
use Storage;
|
||||
|
@ -38,6 +39,10 @@ class PdfCompressor extends Compressor
|
|||
|
||||
exec('convert -density 150 '.escapeshellarg($pdf.'[0]').' -quality 90 '.escapeshellarg($file), $output, $r);
|
||||
|
||||
if (!file_exists($file)) {
|
||||
throw new ResizerException('File cannot be generated from PDF file. Root file is "'.$pdf.'"');
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue