Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save nelson-ph/6969d2034db5ee85bc32f0c55ca1ef6c to your computer and use it in GitHub Desktop.

Select an option

Save nelson-ph/6969d2034db5ee85bc32f0c55ca1ef6c to your computer and use it in GitHub Desktop.
Drupal 7 Tinypng add support for exif or image_toolkit_invoke
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