You are here

function imageapi_optimize_init in Image Optimize (or ImageAPI Optimize) 7

Same name and namespace in other branches
  1. 6 imageapi_optimize.module \imageapi_optimize_init()

Implements hook_init().

Abstract layer to all methods implemented by base toolkit.

File

./imageapi_optimize.module, line 13
Image optimize functionalities.

Code

function imageapi_optimize_init() {
  $cache = cache_get('imageapi_optimize:methods');
  if (!$cache || empty($cache->data) && variable_get('imageapi_optimize_toolkit', '') != '') {
    $methods = _imageapi_optimize_get_methods();
  }
  else {
    $methods = $cache->data;
  }
  foreach ($methods as $method) {
    eval('function image_imageapi_optimize_' . $method . '($image) {
      $params = array_slice(func_get_args(), 1);
      return _imageapi_optimize_invoke("' . $method . '", $image, $params);
    }');
  }
}