我正在創建一個腳本,它創建一個縮略圖,然後將水印原始圖像,但腳本只創建縮略圖並跳過水印。水印和縮略圖 - Codeigniter
$image = $data['json']->{'file_name'};
$data['account'] = $account;
$this->_insertintodb($account, $image);
//Settings to create thumbnail
$config['source_image'] = $data['json']->{'file_path'};
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 125;
$config['height'] = 125;
$this->image_lib->initialize($config);
if($this->image_lib->resize()) {
$prep_thumb = explode('.', $image);
$thumb = $prep_thumb[0] . '_thumb.' . $prep_thumb[1];
$this->_moveimage($thumb, $account, TRUE);
}
$this->image_lib->clear();
//Settings to create watermark overlay
$config = array();
$config['source_image'] = $data['json']->{'file_path'};
$config['wm_type'] = 'overlay';
$config['wm_overlay_path'] = getcwd() . '/design/overlay_watermark_transparent.png';
$config['wm_vrt_alignment'] = 'middle';
$config['wm_hor_alignment'] = 'center';
$this->image_lib->initialize($config);
if(!$this->image_lib->watermark()){
echo $this->image_lib->display_errors();
}
$this->image_lib->clear();
任何想法,爲什麼這不能正常工作?
,如果你單獨做任何一個它的工作原理,但是當你嘗試做在一起不 – dennismonsewicz 2010-06-29 22:24:04
我不太明白你的說法。你能澄清一下嗎? – hundredwatt 2010-06-29 23:20:49
如果你自己運行水印功能,它就可以工作。如果你自己運行縮略圖功能,它就可以工作。但是如果你把它們放在一起,它就不會。 – dennismonsewicz 2010-06-30 03:05:25