Drupal图像缩放器内容错误

时间:2014-07-02 09:18:47

标签: drupal

我正在使用Drupal 7,当我想要公开文章时,我点击admin / content显示错误

    Recoverable fatal error: Argument 1 passed to image_resize() must be an instance of stdClass, boolean given, called in
**my_patch** /sites/all/modules/image_resize_filter/image_resize_filter.module on line 515 and defined w image_resize() (line 279 to /**my_patch**/includes/image.inc).

我该怎么办?

2 个答案:

答案 0 :(得分:0)

您正在代码中发送布尔变量。您应该将stdClass()对象发送给image_resize过滤器。

请参阅What is stdClass in PHP?以了解有关stdClass

的更多信息

请参阅http://api.drupal.org/api/drupal/includes!image.inc/function/image_load/7以了解有关在drupal中使用图像API的更多信息。

答案 1 :(得分:0)

但它应该如何看起来正确的代码?我不知道编程......

第515行的modules / image_resize_filter.module中的

错误:

// Resize the local image if the sizes don't match.
                             elseif ($image['resize']) {
                             $res = image_load($image['local_path']);
       **this is line 515:** image_resize($res, $image['expected_size']['width'], $image['expected_size']['height']);
                             image_save($res, $image['destination']);
      }

in includes / image.inc第279行:

this is line 279 function image_resize(stdClass $image, $width, $height) {
  $width = (int) round($width);
  $height = (int) round($height);

  return image_toolkit_invoke('resize', $image, array($width, $height));
}