SQL/DB Error -- [
    Error establishing a database connection!
  1. Are you sure you have the correct user/password?
  2. Are you sure that you have typed the correct hostname?
  3. Are you sure that the database server is running?
]
SQL/DB Error -- [
    Error selecting database MYSQL_DB_NAME!
  1. Are you sure it exists?
  2. Are you sure there is a valid database connection?
]
0){ //if the image is one of the 3 supported file types //check the pixel size of the original image $old_x=imageSX($working_name); $old_y=imageSY($working_name); //check if the pixel size of the image is larger than //the wanted size - i.e. is there a need to resize it or not if ($old_x > $wanted_size || $old_y > $wanted_size){ //check if the image is horizonally or vertically //oriented (is it wider or higher) if ($old_x > $old_y){$higher_value=$old_x;} if ($old_y > $old_x){$higher_value=$old_y;} if ($old_y == $old_x){$higher_value=$old_y;} //check the factor by which the original //is bigger than the wanted size $factor= $higher_value / $wanted_size; //calculate the new size of the image $new_x=round($old_x / $factor); $new_y=round($old_y / $factor); //create empty image of desired size $new_img=ImageCreateTrueColor($new_x,$new_y); //copy original image into new image imagecopyresampled($new_img,$working_name,0,0,0,0,$new_x,$new_y,$old_x,$old_y); //delete old image IF new name is the same if ($new_name == $old_name){unlink($old_name);} //save new image if ($type==1){imagejpeg($new_img,$new_name);} if ($type==2){imagepng($new_img,$new_name);} if ($type==3){imagegif($new_img,$new_name);} //destroy the temporary images imagedestroy($working_name); imagedestroy($new_img); //set size of new image $new_size=filesize($new_name); } else { // if no resize needed //create empty image of desired size $new_img=ImageCreateTrueColor($old_x,$old_y); //copy original image into new image imagecopyresampled($new_img,$working_name,0,0,0,0,$old_x,$old_y,$old_x,$old_y); if(!file_exists($new_name)){ // if the file of a given name doesn't exist //save new image if ($type==1){imagejpeg($new_img,$new_name);} if ($type==2){imagepng($new_img,$new_name);} if ($type==3){copy ($old_name,$new_name);} } } // end if no resize needed }else{ // if not readable print "
Image format of file $old_name is not supported.
"; } // end if not readable } } ?>
SQL/DB Error -- [php_network_getaddresses: getaddrinfo failed: Name or service not known]
SQL/DB Error -- [php_network_getaddresses: getaddrinfo failed: Name or service not known]
SQL/DB Error -- [Access denied for user ''@'localhost' (using password: NO)]
SQL/DB Error -- [Access denied for user ''@'localhost' (using password: NO)]