|
if($makemin == 1)
{
$this->image_lib->clear();
$smallpic = $struniqid.'_wm'.$srcimg['file_ext'];
$resizeconfig['image_library'] = 'gd2';
$resizeconfig['source_image'] = $srcimg['full_path'];
$resizeconfig['create_thumb'] = TRUE;
$resizeconfig['maintain_ratio'] = TRUE;
$resizeconfig['new_image']= $smallpic;
$resizeconfig['width'] = 168;
$resizeconfig['height'] = 168;
$this->image_lib->initialize($resizeconfig);
if(!$this->image_lib->resize())
{
echo '产生错误:'.$this->image_lib->display_errors();
}
$minipicpath = '/uploads/images/'.$smallpic;
}
if($markflag == 1)
{
$this->image_lib->clear();
$wmpic = $struniqid.'_wm'.$srcimg['file_ext'];
$wmconfig['source_image'] = $srcimg['full_path'];
$wmconfig['image_library'] = 'gd2';
$wmconfig['wm_text'] = 'JINTAIMUSEUM';
$wmconfig['wm_type'] = 'text';
$wmconfig['wm_font_path'] = BASEPATH . 'fonts/airstrip.ttf';
$wmconfig['wm_font_size'] = '28';
$wmconfig['wm_font_color'] = 'DFDBDB';
$wmconfig['wm_vrt_alignment'] = 'bottom';
$wmconfig['wm_hor_alignment'] = 'center';
// $wmconfig['new_image']= $wmpic;
$wmconfig['padding'] = 10;
$this->image_lib->initialize($wmconfig);
if(!$this->image_lib->watermark())
{
echo "产生异常:".$this->image_lib->display_errors();
}
$dataout['filepath'] = '/uploads/images/'.$wmpic;
}
在这个代码中,如果$wmconfig['new_image']= $wmpic;不被注释掉的话,在目录中就看不到resize()生成的$smallpic,如果注释掉就可以看到,请问这是问什么? |
|