function create_thumbs($updir, $img, $name, $thumbnail_width, $thumbnail_height, $quality){
	$arr_image_details	= GetImageSize("$updir/$img");
	$original_width		= $arr_image_details[0];
	$original_height	= $arr_image_details[1];
	$a = $thumbnail_width / $thumbnail_height;
  $b = $original_width / $original_height;
	
	
	if ($a<$b) {
     $new_width = $thumbnail_width;
     $new_height	= intval($original_height*$new_width/$original_width);
  } else {
     $new_height = $thumbnail_height;
     $new_width	= intval($original_width*$new_height/$original_height);
  }
	
	if(($original_width <= $thumbnail_width) AND ($original_height <= $thumbnail_height)) {
	  $new_width = $original_width;
	  $new_height = $original_height;
  }	
	if($arr_image_details[2]==1) { $imgt = "imagegif"; $imgcreatefrom = "imagecreatefromgif";  }
	if($arr_image_details[2]==2) { $imgt = "imagejpeg"; $imgcreatefrom = "imagecreatefromjpeg";  }
	if($arr_image_details[2]==3) { $imgt = "imagepng"; $imgcreatefrom = "imagecreatefrompng";  }
	if($imgt) { 
		$old_image	= $imgcreatefrom("$updir/$img");
		$new_image	= imagecreatetruecolor($new_width, $new_height);
		imagecopyresampled($new_image,$old_image,0,0,0,0,$new_width,$new_height,$original_width,$original_height);
		imagejpeg($new_image,"$updir/$name",$quality);
		imagedestroy($new_image);
	}
}
The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment.