← All changes
|
vendor/rosell-dk/webp-convert/src/Convert/Converters/AbstractConverter.php
+2
-1
3.2.9
→
trunk
View file →
| @@ -211,8 +211,9 @@ | ||
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | protected function logReduction($source, $destination) |
| 214 | 214 | { |
| 215 | + if (!file_exists($source) || !file_exists($destination)) return; | |
| 215 | 216 | $sourceSize = filesize($source); |
| 216 | 217 | $destSize = filesize($destination); |
| 217 | 218 | $this->log(round(($sourceSize - $destSize) / $sourceSize * 100) . '% '); |
| 218 | 219 | if ($sourceSize < 10000) { |
| @@ -259,9 +260,9 @@ | ||
| 259 | 260 | |
| 260 | 261 | if (!@file_exists($destination)) { |
| 261 | 262 | throw new ConversionFailedException('Destination file is not there: ' . $destination); |
| 262 | 263 | } elseif (@filesize($destination) === 0) { |
| 263 | - unlink($destination); | |
| 264 | + @unlink($destination); | |
| 264 | 265 | throw new ConversionFailedException('Destination file was completely empty'); |
| 265 | 266 | } else { |
| 266 | 267 | if (!isset($this->options['_suppress_success_message'])) { |
| 267 | 268 | $this->ln(); |