0

Im using Drupal 7 and when I want public article I click in admin/content shows up error

    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).

What should I do?

Lilith River
  • 16,204
  • 2
  • 44
  • 76

2 Answers2

0

You are sending a boolean variable in your code. You should be sending a stdClass() object to you image_resize filter instead.

Refer What is stdClass in PHP? to know more about stdClass

Refer http://api.drupal.org/api/drupal/includes!image.inc/function/image_load/7 to know more about working with images API in drupal.

Community
  • 1
  • 1
Jerry Ajay
  • 1,084
  • 11
  • 26
0

But how it should look correct code? I have no idea about programming...

error in modules/image_resize_filter.module on line 515:

// 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 line 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));
}