← All changes
|
vendor/rosell-dk/webp-convert/src/Convert/Converters/ConverterTraits/EncodingAutoTrait.php
+16
-16
3.2.21
→
4.7.0
View file →
| @@ -66,26 +66,26 @@ | ||
| 66 | 66 | $this->log('Reduction: '); |
| 67 | 67 | $this->logReduction($this->getSource(), $destinationLossless); |
| 68 | 68 | $this->ln(); |
| 69 | 69 | |
| 70 | - if (file_exists($destinationLossless) && file_exists($destinationLossy)) { | |
| 71 | - if (filesize($destinationLossless) > filesize($destinationLossy)) { | |
| 72 | - $this->logLn('Picking lossy'); | |
| 73 | - unlink($destinationLossless); | |
| 74 | - rename($destinationLossy, $destination); | |
| 75 | - } else { | |
| 76 | - $this->logLn('Picking lossless'); | |
| 77 | - unlink($destinationLossy); | |
| 78 | - rename($destinationLossless, $destination); | |
| 79 | - } | |
| 70 | + if (file_exists($destinationLossless) && file_exists($destinationLossy)) { | |
| 71 | + if (filesize($destinationLossless) > filesize($destinationLossy)) { | |
| 72 | + $this->logLn('Picking lossy'); | |
| 73 | + unlink($destinationLossless); | |
| 74 | + rename($destinationLossy, $destination); | |
| 80 | 75 | } else { |
| 81 | - if (file_exists($destinationLossless)) { | |
| 82 | - rename($destinationLossless, $destination); | |
| 83 | - } | |
| 84 | - if (file_exists($destinationLossy)) { | |
| 85 | - rename($destinationLossy, $destination); | |
| 86 | - } | |
| 76 | + $this->logLn('Picking lossless'); | |
| 77 | + unlink($destinationLossy); | |
| 78 | + rename($destinationLossless, $destination); | |
| 87 | 79 | } |
| 80 | + } else { | |
| 81 | + if (file_exists($destinationLossless)) { | |
| 82 | + rename($destinationLossless, $destination); | |
| 83 | + } | |
| 84 | + if (file_exists($destinationLossy)) { | |
| 85 | + rename($destinationLossy, $destination); | |
| 86 | + } | |
| 87 | + } | |
| 88 | 88 | $this->setDestination($destination); |
| 89 | 89 | $this->setOption('encoding', 'auto'); |
| 90 | 90 | } |
| 91 | 91 | |