diff --git a/src/ImageOptimize.php b/src/ImageOptimize.php index 86193867..283fdbda 100644 --- a/src/ImageOptimize.php +++ b/src/ImageOptimize.php @@ -351,6 +351,8 @@ static function (ImageTransformerOperationEvent $event): void { $event ); if ($tempPath) { + // Remove the old Craft generated transform that's still sitting in the temp directory. + @unlink($event->tempPath); $event->tempPath = $tempPath; } }