Update Intervention/Image class to v3
This commit is contained in:
parent
58a03ef931
commit
6d5b298837
6 changed files with 84 additions and 46 deletions
|
@ -10,7 +10,7 @@ use Illuminate\Foundation\Bus\Dispatchable;
|
|||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Intervention\Image\Exception\NotReadableException;
|
||||
use Intervention\Image\Exceptions\DecoderException;
|
||||
use Intervention\Image\ImageManager;
|
||||
|
||||
class ProcessMedia implements ShouldQueue
|
||||
|
@ -35,8 +35,8 @@ class ProcessMedia implements ShouldQueue
|
|||
{
|
||||
//open file
|
||||
try {
|
||||
$image = $manager->make(storage_path('app') . '/' . $this->filename);
|
||||
} catch (NotReadableException $exception) {
|
||||
$image = $manager->read(storage_path('app') . '/' . $this->filename);
|
||||
} catch (DecoderException) {
|
||||
// not an image; delete file and end job
|
||||
unlink(storage_path('app') . '/' . $this->filename);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue