Php 调整相同图像的大小2次
我上传了一个php脚本的图像,我想能够改变图像的大小,如果图像太大,然后创建一个拇指相同的图像,现在我的图像大小调整,但拇指没有创建的原因…没有错误。 以下是脚本: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_
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); // <--- !!!