← All changes
|
vendor/rosell-dk/webp-convert/src/Convert/Converters/Vips.php
+8
-8
3.2.3
→
trunk
View file →
| @@ -76,11 +76,11 @@ | ||
| 76 | 76 | ); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
| 80 | - /** @scrutinizer ignore-call */ vips_error_buffer(); // clear error buffer | |
| 81 | - $result = /** @scrutinizer ignore-call */ vips_call('webpsave', null); | |
| 82 | - if ($result == -1) { | |
| 80 | + vips_error_buffer(); // clear error buffer | |
| 81 | + $result = vips_call('webpsave', null); | |
| 82 | + if ($result === -1) { | |
| 83 | 83 | $message = vips_error_buffer(); |
| 84 | 84 | if (strpos($message, 'VipsOperation: class "webpsave" not found') === 0) { |
| 85 | 85 | throw new SystemRequirementsNotMetException( |
| 86 | 86 | 'Vips has not been compiled with webp support.' |
| @@ -207,11 +207,11 @@ | ||
| 207 | 207 | return $options; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | /** |
| 211 | - * Convert with vips extension. | |
| 211 | + * Save as webp, using vips extension. | |
| 212 | 212 | * |
| 213 | - * Tries to create image resource and save it as webp using the calculated options. | |
| 213 | + * Tries to save image resource as webp, using the supplied options. | |
| 214 | 214 | * Vips fails when a parameter is not supported, but we detect this and unset that parameter and try again |
| 215 | 215 | * (recursively call itself until there is no more of these kind of errors). |
| 216 | 216 | * |
| 217 | 217 | * @param resource $im A vips image resource to save |
| @@ -278,13 +278,13 @@ | ||
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | /** |
| 282 | - * Convert with vips extension. | |
| 282 | + * Convert, using vips extension. | |
| 283 | 283 | * |
| 284 | 284 | * Tries to create image resource and save it as webp using the calculated options. |
| 285 | - * Vips fails when a parameter is not supported, but we detect this and unset that parameter and try again | |
| 286 | - * (repeat until success). | |
| 285 | + * PS: The Vips "webpsave" call fails when a parameter is not supported, but our webpsave() method | |
| 286 | + * detect this and unset that parameter and try again (repeat until success). | |
| 287 | 287 | * |
| 288 | 288 | * @throws ConversionFailedException if conversion fails. |
| 289 | 289 | */ |
| 290 | 290 | protected function doActualConvert() |