I need an emergency help. My space is going
over 2 gigabyte, cause of the original files.
I wanna keep this big-function, but
to limit it. Many of my pictures
(uploaded by members) have a size of 3,4 sometimes 5 megabyte!
That's to much (all in all)... so:
1.
how to decrease automatically also the (into the big-folder copied) image?
So far, during the uploading process, it only copies the original file.
I need something like: decrease to
max 1680*1050, jpg-quality: 852. how to do this with existing pictures (without doing it manually for each one)?
Thanx
Sebas
I guess, it's somewhere here in the member.php?!
//--------------------------------------------
//--------- Auto Image Resizing --------------
//--------------------------------------------
if ($config['auto_image'] && !$uploaderror) {
$src_copy = MEDIA_PATH."/".$cat_id."/big";
if ($direct_upload) {
$src = MEDIA_PATH."/".$cat_id."/".$new_name;
$src_copy = MEDIA_PATH."/".$cat_id."/big";
}
else {
$src = MEDIA_TEMP_PATH."/".$new_name;
}
$do_resize = 0;
if ($image_info = @getimagesize($src)) {
if ($image_info[2] == 1 || $image_info[2] == 2 || $image_info[2] == 3) {
$do_resize = 1;
}
}
if ($do_resize) {
if (!function_exists(init_convert_options)) {
require(ROOT_PATH.'includes/image_utils.php');
}
$convert_options = init_convert_options();
if (!$convert_options['convert_error']) {
if ($image_info[0] > $config['max_image_width'] || $image_info[1] > $config['max_image_height']) {
$result = true;
if (!@is_dir($src_copy)) {
$oldumask = umask(0);
$result = mkdir($src_copy);
umask($oldumask);
if (!@is_dir($src_copy) || !$result) {
$result = mkdir($src_copy, 0755);
}
}
if ($result == true){
copy($src, $src_copy."/".$new_name);
}
$convert_options = init_convert_options();
if (!$convert_options['convert_error']) {
$quality = (intval($config['auto_image_quality']) && intval($config['auto_image_quality']) <= 100) ? intval($config['auto_image_quality']) : 100;
if (!resize_image($src, $quality, $config['max_image_width'], 1)) {
$msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$new_name;
$uploaderror = 1;
}
}
}else{
$do_resize = 0;
}
}
}
}
//-------------------------------------------