Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.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 调整相同图像的大小2次_Php_Codeigniter_Image Manipulation_Image Uploading - Fatal编程技术网

Php 调整相同图像的大小2次

Php 调整相同图像的大小2次,php,codeigniter,image-manipulation,image-uploading,Php,Codeigniter,Image Manipulation,Image Uploading,我上传了一个php脚本的图像,我想能够改变图像的大小,如果图像太大,然后创建一个拇指相同的图像,现在我的图像大小调整,但拇指没有创建的原因…没有错误。 以下是脚本: if($image_data['image_width'] > 1024 || $image_data['image_height'] > 768) { $config_resize = array( 'source_image' => $image_

我上传了一个php脚本的图像,我想能够改变图像的大小,如果图像太大,然后创建一个拇指相同的图像,现在我的图像大小调整,但拇指没有创建的原因…没有错误。 以下是脚本:

        if($image_data['image_width'] > 1024 || $image_data['image_height'] > 768)
      {


    $config_resize = array(
            'source_image' => $image_data['full_path'],
            'new_image' => "./uploads/",
            'overwrite' => true,
            'maintain_ratio' => true,
            'width' => 1024,
            'height' => 768
            );
     $this->load->library('image_lib', $config_resize);
     if(! $this->image_lib->resize())
       {
         echo $this->image_lib->display_errors();
       }


    $config_thumb = array(
        'source_image' => $config_resize['source_image'],
        'new_image' => "./uploads/thumbs/",
        'maintain_ratio' => true,
        'width' => 150,
        'height' => 100
        );
    $this->load->library('image_lib', $config_thumb);

    if(! $this->image_lib->resize())
       {
         echo $this->image_lib->display_errors();
       }


      }
。。。。。
.....  
$config\u thumb=数组(
'source_image'=>$config_resize['source_image'],
“新建图像”=>“/uploads/thumbs/”,
“保持_比率”=>true,
“宽度”=>150,
“高度”=>100
);
$this->image\u lib->initialize($config\u thumb)//
.....
.....  

    $config_thumb = array(
                'source_image' => $config_resize['source_image'],
                'new_image' => "./uploads/thumbs/",
                'maintain_ratio' => true,
                'width' => 150,
                'height' => 100
                );

$this->image_lib->initialize($config_thumb); // <--- !!!