@@ -106,14 +106,14 @@ |
||
| 106 | 106 | return false; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - //change the RGB values if you need, but leave alpha at 127 |
|
| 109 | + //change the RGB values if you need, but leave alpha at 127 |
|
| 110 | 110 | $transparent = imagecolorallocatealpha($dst, 255, 255, 255, 127); |
| 111 | 111 | |
| 112 | 112 | if ($transparent === false) { |
| 113 | 113 | return false; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - //simpler than flood fill |
|
| 116 | + //simpler than flood fill |
|
| 117 | 117 | if (imagefilledrectangle($dst, 0, 0, imagesx($image), imagesy($image), $transparent) === false) { |
| 118 | 118 | return false; |
| 119 | 119 | } |
@@ -39,9 +39,9 @@ |
||
| 39 | 39 | if ($sizeInIni < $fileSize) { |
| 40 | 40 | throw new ConversionFailedException( |
| 41 | 41 | 'File is larger than your ' . $iniSettingId . ' (set in your php.ini). File size:' . |
| 42 | - round($fileSize/1024) . ' kb. ' . |
|
| 42 | + round($fileSize / 1024) . ' kb. ' . |
|
| 43 | 43 | $iniSettingId . ' in php.ini: ' . ini_get($iniSettingId) . |
| 44 | - ' (parsed as ' . round($sizeInIni/1024) . ' kb)' |
|
| 44 | + ' (parsed as ' . round($sizeInIni / 1024) . ' kb)' |
|
| 45 | 45 | ); |
| 46 | 46 | } |
| 47 | 47 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | * @param string $msg message to log |
| 22 | 22 | * @param string $style style (null | bold | italic) |
| 23 | 23 | * @return void |
| 24 | - */ |
|
| 24 | + */ |
|
| 25 | 25 | public function log($msg, $style = '') |
| 26 | 26 | { |
| 27 | 27 | $this->entries[] = [$msg, $style]; |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * @param string $msg message to log |
| 19 | 19 | * @param string $style style (null | bold | italic) |
| 20 | 20 | * @return void |
| 21 | - */ |
|
| 21 | + */ |
|
| 22 | 22 | public function log($msg, $style = '') |
| 23 | 23 | { |
| 24 | 24 | $msg = htmlspecialchars($msg); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * Handle ln by echoing a <br> tag. |
| 36 | 36 | * |
| 37 | 37 | * @return void |
| 38 | - */ |
|
| 38 | + */ |
|
| 39 | 39 | public function ln() |
| 40 | 40 | { |
| 41 | 41 | echo '<br>'; |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * @param string $msg message to log |
| 21 | 21 | * @param string $style style (null | bold | italic) |
| 22 | 22 | * @return void |
| 23 | - */ |
|
| 23 | + */ |
|
| 24 | 24 | abstract public function log($msg, $style = ''); |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @param string $msg message to log |
| 36 | 36 | * @param string $style style (null | bold | italic) |
| 37 | 37 | * @return void |
| 38 | - */ |
|
| 38 | + */ |
|
| 39 | 39 | public function logLn($msg, $style = '') |
| 40 | 40 | { |
| 41 | 41 | $this->log($msg, $style); |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | * |
| 65 | 65 | * @throws \WebPConvert\Convert\Exceptions\ConversionFailedException in case conversion fails |
| 66 | 66 | * @return void |
| 67 | - */ |
|
| 67 | + */ |
|
| 68 | 68 | public static function convert($source, $destination, $options = [], $logger = null) |
| 69 | 69 | { |
| 70 | 70 | Stack::convert($source, $destination, $options, $logger); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $options = self::processOptions($options); |
| 87 | 87 | |
| 88 | 88 | if ($options['headers']['last-modified']) { |
| 89 | - Header::setHeader("Last-Modified: " . gmdate("D, d M Y H:i:s", @filemtime($filename)) ." GMT"); |
|
| 89 | + Header::setHeader("Last-Modified: " . gmdate("D, d M Y H:i:s", @filemtime($filename)) . " GMT"); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | if ($options['headers']['content-type']) { |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | // Check string for something like this: max-age:86400 |
| 107 | 107 | if (preg_match('#max-age\\s*=\\s*(\\d*)#', $options['cache-control-header'], $matches)) { |
| 108 | 108 | $seconds = $matches[1]; |
| 109 | - Header::setHeader('Expires: '. gmdate('D, d M Y H:i:s \G\M\T', time() + intval($seconds))); |
|
| 109 | + Header::setHeader('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + intval($seconds))); |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -134,7 +134,7 @@ |
||
| 134 | 134 | $defaultConverterOptions = []; |
| 135 | 135 | |
| 136 | 136 | foreach ($this->options2->getOptionsMap() as $id => $option) { |
| 137 | - if ($option->isValueExplicitlySet() && ! ($option instanceof GhostOption)) { |
|
| 137 | + if ($option->isValueExplicitlySet() && !($option instanceof GhostOption)) { |
|
| 138 | 138 | //$this->logLn('hi' . $id); |
| 139 | 139 | $defaultConverterOptions[$id] = $option->getValue(); |
| 140 | 140 | } |
@@ -212,11 +212,11 @@ |
||
| 212 | 212 | { |
| 213 | 213 | $sourceSize = filesize($source); |
| 214 | 214 | $destSize = filesize($destination); |
| 215 | - $this->log(round(($sourceSize - $destSize)/$sourceSize * 100) . '% '); |
|
| 215 | + $this->log(round(($sourceSize - $destSize) / $sourceSize * 100) . '% '); |
|
| 216 | 216 | if ($sourceSize < 10000) { |
| 217 | - $this->logLn('(went from ' . strval($sourceSize) . ' bytes to '. strval($destSize) . ' bytes)'); |
|
| 217 | + $this->logLn('(went from ' . strval($sourceSize) . ' bytes to ' . strval($destSize) . ' bytes)'); |
|
| 218 | 218 | } else { |
| 219 | - $this->logLn('(went from ' . round($sourceSize/1024) . ' kb to ' . round($destSize/1024) . ' kb)'); |
|
| 219 | + $this->logLn('(went from ' . round($sourceSize / 1024) . ' kb to ' . round($destSize / 1024) . ' kb)'); |
|
| 220 | 220 | } |
| 221 | 221 | } |
| 222 | 222 | |