[PLUGIN][ImageEncoder] If vips doesn't support, don't throw exception, just let other plugin try

This commit is contained in:
Diogo Peralta Cordeiro 2021-12-26 21:52:18 +00:00
parent 838510ced2
commit 58715f1733
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0
1 changed files with 4 additions and 5 deletions

View File

@ -34,7 +34,6 @@ use App\Util\Formatting;
use App\Util\TemporaryFile;
use Exception;
use Jcupitt\Vips;
use Plugin\ImageEncoder\Exception\UnsupportedFileTypeException;
use SplFileInfo;
/**
@ -100,8 +99,8 @@ class ImageEncoder extends Plugin
try {
$image = Vips\Image::newFromFile($file->getRealPath(), ['access' => 'sequential']);
} catch (Vips\Exception $e) {
Log::debug("ImageEncoder's Vips couldn't handle the image file, failed with {$e}.");
throw new UnsupportedFileTypeException(_m("Unsupported image file with {$mimetype}.", previous: $e));
Log::debug("ImageEncoder's Vips couldn't handle the image file, failed with {$e->getMessage()}.", [$e]);
return false;
}
$width = $image->width;
$height = $image->height;
@ -154,8 +153,8 @@ class ImageEncoder extends Plugin
try {
$image = Vips\Image::newFromFile($file->getRealPath(), ['access' => 'sequential']);
} catch (Vips\Exception $e) {
Log::debug("ImageEncoder's Vips couldn't handle the image file, failed with {$e}.");
throw new UnsupportedFileTypeException(_m("Unsupported image file with {$mimetype}.", previous: $e));
Log::debug("ImageEncoder's Vips couldn't handle the image file, failed with {$e->getMessage()}.", [$e]);
return false;
}
$width = $image->width;
$height = $image->height;