diff --git a/src/services/Optimize.php b/src/services/Optimize.php index e4f17f4..e851b4d 100644 --- a/src/services/Optimize.php +++ b/src/services/Optimize.php @@ -641,7 +641,7 @@ protected function applyFiltersToImage(AssetTransform $transform, Asset $asset, /** @var Settings $settings */ $settings = ImageOptimize::$plugin->getSettings(); // Only try to apply filters to Raster images - if ($image instanceof Raster) { + if ($image instanceof Raster && $asset->getWidth() > 0 && $asset->getHeight() > 0) { $imagineImage = $image->getImagineImage(); // Handle auto-sharpening scaled down images if ($imagineImage !== null && $settings->autoSharpenScaledImages) {