[eluser]vollossy[/eluser]
Hello. I've got problem with image resizing. When i try to set $config['new_image'] to absolute path i get an error: "Unable to save the image. Please make sure the image and file directory are writable.", but whe i set it to relative path - al works correct.
Here's the code:
Code:
$this->CI->lang->load('error', 'russian');
list($currWidth, $currHeight) = getimagesize($source);
$sidesRelation = $currWidth / $currHeight;
if ($onlyShrink && ($sidesRelation > 1)) {
$config['image_library'] = 'gd2';
$config['source_image'] = $source;
$config['new_image'] = 'Y:\home\rb26\www\uploads\new_image.jpg';
$config['width'] = $newWidth;
$config['height'] = $newWidth * $sidesRelation;
var_dump($config);
$this->CI->load->library('image_lib', $config);
if ($this->CI->image_lib->resize()) {
return "ok";
} else {
return $this->CI->image_lib->display_errors();
//return $this->CI->lang->line('ssitl_error');
}
}else{
return $this->CI->lang->line('ssitl_error_only_shrink');
}