Created
November 28, 2018 09:41
-
-
Save nelson-ph/6969d2034db5ee85bc32f0c55ca1ef6c to your computer and use it in GitHub Desktop.
Drupal 7 Tinypng add support for exif or image_toolkit_invoke
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Index: includes/image.inc | |
| IDEA additional info: | |
| Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
| <+>UTF-8 | |
| =================================================================== | |
| --- includes/image.inc (date 1543397842000) | |
| +++ includes/image.inc (date 1543397842000) | |
| @@ -96,6 +96,17 @@ | |
| array_unshift($params, $image); | |
| return call_user_func_array($function, $params); | |
| } | |
| + else{ | |
| + if($image->toolkit === 'tinypng'){ | |
| + $fallback = variable_get('tinypng_fallback_toolkit', 'gd'); | |
| + | |
| + $function = 'image_' . $fallback . '_' . $method; | |
| + if (function_exists($function)) { | |
| + array_unshift($params, $image); | |
| + return call_user_func_array($function, $params); | |
| + } | |
| + } | |
| + } | |
| watchdog('image', 'The selected image handling toolkit %toolkit can not correctly process %function.', array('%toolkit' => $image->toolkit, '%function' => $function), WATCHDOG_ERROR); | |
| return FALSE; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment