Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 可捕获的致命错误:无法将SimpleImage类的对象转换为字符串_Php_Image Resizing_Fatal Error - Fatal编程技术网

Php 可捕获的致命错误:无法将SimpleImage类的对象转换为字符串

Php 可捕获的致命错误:无法将SimpleImage类的对象转换为字符串,php,image-resizing,fatal-error,Php,Image Resizing,Fatal Error,我犯了一个我从未见过的错误 Catchable fatal error: Object of class SimpleImage could not be converted to string in /home/content/44/8713044/html/admin/classes/SimpleImage.php on line 10 我正在使用这个名为SimpleImage的插件 我不知道为什么我会出现这个错误,这个插件的作用是,它拍摄图像,调整大小并上传到服务器,有人知道我为什么会出

我犯了一个我从未见过的错误

Catchable fatal error: Object of class SimpleImage could not be converted to string in /home/content/44/8713044/html/admin/classes/SimpleImage.php on line 10
我正在使用这个名为SimpleImage的插件

我不知道为什么我会出现这个错误,这个插件的作用是,它拍摄图像,调整大小并上传到服务器,有人知道我为什么会出现这个错误以及如何修复它吗

谢谢, J

这就是发生错误的地方

   function load($filename) {

      $image_info = getimagesize($filename);
      $this->image_type = $image_info[2];
      if( $this->image_type == IMAGETYPE_JPEG ) {

         $this->image = imagecreatefromjpeg($filename);
      } elseif( $this->image_type == IMAGETYPE_GIF ) {

         $this->image = imagecreatefromgif($filename);
      } elseif( $this->image_type == IMAGETYPE_PNG ) {

         $this->image = imagecreatefrompng($filename);
      }
   }

你能告诉我们导致这个错误的代码吗?最有可能的情况是,您正在使用SimpleImage的一个实例作为一个函数中的参数,该函数需要一个字符串。好吧,我算出了……我有一个变量拼写错误:啊,总是最糟糕的!很高兴你明白了。