Reply to Re: Upload bright color image become darken

Re: Upload bright color image become darken new!
by Ting, 5 years, 1 month ago
Original file
http://tinypic.com/r/300b320/9

After upload
http://tinypic.com/r/zk65h3/9

Script

// save uploaded image with no changes
$img_class->file_new_name_body = $image_name;

$img_class->image_resize = false;
$img_class->image_ratio_crop = false;

// save to root $path
if ($key_w == '358' && $value_h == '358'){// to 500x492 folder
$img_class->image_resize = true;
$img_class->image_x = $key_w;
$img_class->image_y = $value_h;
// fit image to specific size
$img_class->image_ratio_crop = true;
// no image part, set background color
//$img_class->image_background_color = '#fff';
}elseif($key_dir == 'b'){ // to b folder
$img_folder = $key_dir.'/';
}else{// save to *x* folder
$img_class->image_resize = true;
$img_class->image_x = $key_w;
$img_class->image_y = $value_h;
// crop image
$img_class->image_ratio_crop = true;
$img_folder = $key_dir.'/';
}

//$img_class->image_ratio_fill = true;
//$img_class->image_background_color = '#fff';

$img_class->file_overwrite = true;
$img_class->dir_auto_create = true;
$img_class->Process($_SERVER['DOCUMENT_ROOT'].'/Uploads/'.$path.'/'.$img_folder);
if ($img_class->processed) {/*echo 'original image copied'; echo $img_class->file_dst_name;*/} else {echo 'error : ' . $img_class->error;}Reply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important