the converted image appears in black and white instead of color, so I added the ‘-colorspace sRGB’ option to solve this problem, but it does not work.
public function publish_remake_image()
{
$temp_name = time();
$this->IMG = $this->input->get('dfimg');
// 800 ȵǴ ū ̹
list($width, $height, $type, $attr) = getimagesize($this->IMG);
if($width < 800 && $height < 1180 || $width < 950 && $height < 610 ) {
// ̹ ٿ ε
//if(!file_exists($img)) {
$this->load->library('srbftp'); // ftp ۰
$img = $this->srbftp->design_tmp_save($this->IMG, $temp_name );
//}
$this->REIMG = 'http://'.$_SERVER['HTTP_HOST'].'/tmp/design_tmp/'.$temp_name.'_re.jpg';
//if(!file_exists($this->REIMG)) {
// ū ̹
shell_exec('/usr/local/imagemagick/bin/composite -size 800x1180 -gravity center '.$img.' '.$_SERVER['DOCUMENT_ROOT'].'/images/bg_convert.png -colorspace sRGB '.$_SERVER['DOCUMENT_ROOT'].'/tmp/design_tmp/'.$temp_name.'_re.jpg');
//}
} elseif($width < 950 && $height < 610) {
// ̹ ٿ ε
//if(!file_exists($img)) {
$this->load->library('srbftp'); // ftp ۰
$img = $this->srbftp->design_tmp_save($this->IMG, $temp_name );
//}
$this->REIMG = 'http://'.$_SERVER['HTTP_HOST'].'/tmp/design_tmp/'.$temp_name.'_re.jpg';
//if(!file_exists($this->REIMG)) {
// ū ̹
shell_exec('/usr/local/imagemagick/bin/composite -size 1180x800 -gravity center '.$img.' '.$_SERVER['DOCUMENT_ROOT'].'/images/bg_convert_1.png -colorspace sRGB '.$_SERVER['DOCUMENT_ROOT'].'/tmp/design_tmp/'.$temp_name.'_re.jpg');
//}
} else {
$this->REIMG = $this->IMG;
}
//$this->load->view('head_no');
$this->output->set_header("Content-Type:text/html; charset=euc-kr");
$this->load->view('contract/contract_image_remake');
}
the converted image appears in black and white instead of color, so I added the ‘-colorspace sRGB’ option to solve this problem, but it does not work.
New contributor
Jinhyeok is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.