diff --git a/compressors/JpgCompressor.php b/compressors/JpgCompressor.php index abceb24..5beb199 100644 --- a/compressors/JpgCompressor.php +++ b/compressors/JpgCompressor.php @@ -54,6 +54,8 @@ class JpgCompressor extends Compressor $versionFilename = $this->media->versionsDirPath().'/'.$this->versionFilename($destWidth, $destHeight); if ($update && Storage::exists($versionFilename)) { + Storage::delete($temp); + return; } diff --git a/compressors/PngCompressor.php b/compressors/PngCompressor.php index d2884f8..173ee51 100644 --- a/compressors/PngCompressor.php +++ b/compressors/PngCompressor.php @@ -64,6 +64,8 @@ class PngCompressor extends Compressor $versionFilename = $this->media->versionsDirPath().'/'.$this->versionFilename($destWidth, $destHeight); if ($update && Storage::exists($versionFilename)) { + Storage::delete($temp); + return; }