chmod($prod_img, octdec($mode)); $sizes = getimagesize($prod_img); $aspect_ratio = $sizes[1] / $sizes[0]; if ($sizes[1] <= $size) { $new_width = $sizes[0]; $new_height = $sizes[1]; } else { $new_height = $size; $new_width = abs($new_height / $aspect_ratio); } $destimg = ImageCreateTrueColor($new_width, $new_height) or die('Problem In Creating image'); $srcimg = ImageCreateFromJPEG($prod_img) or die('Problem In opening Source Image'); if (function_exists('imagecopyresampled')) { imagecopyresampled($destimg, $srcimg, 0, 0, 0, 0, $new_width, $new_height, ImageSX($srcimg), ImageSY($srcimg)) or die('Problem In resizing'); } else { Imagecopyresized($destimg, $srcimg, 0, 0, 0, 0, $new_width, $new_height, ImageSX($srcimg), ImageSY($srcimg)) or die('Problem In resizing'); } ImageJPEG($destimg, $prod_img_thumb, 90) or die('Problem In saving'); imagedestroy($destimg); $profile_pic_location = $prod_img; $thumbnails = $prod_img_thumb; } } else { echo "Invalid photo upload"; } $sql_regestring_princi_db = "INSERT INTO registered_members\r\n(usn,name,password,email,phone,whatsapp,roomno,branch,thumbnails,photo_add)VALUES\r\n('{$usn}','{$name}','{$password}','{$email}',{$tel},'{$whatsapp}',{$room_no},'{$branch}','{$prod_img_thumb}','{$profile_pic_location}')"; if (!mysqli_query($con, $sql_regestring_princi_db)) { echo "<span style='color:white;'>Failed to create user account try different usn or email</span>"; //line 128 } else { $photo = $usn . "photo_add_self";
$new_width = $sizes[0]; $new_height = $sizes[1]; }else{ $new_height = $size; $new_width = abs($new_height/$aspect_ratio); } $destimg=ImageCreateTrueColor($new_width,$new_height) or die('Fouten bij het genereren van afbeelding.'); $srcimg=ImageCreateFromJPEG($prod_img) or die('Fout bij het openen van afbeelding.'); if(function_exists('imagecopyresampled')) { imagecopyresampled($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die('Fout bij het afmeting aanpassen.'); }else{ Imagecopyresized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die('Fout bij het afmeting aanpassen.'); } ImageJPEG($destimg,$prod_img_thumb,90) or die('Fout bij het opslaan'); imagedestroy($destimg); } // Sluit isset image name echo ' <a href="'.$prod_img.'"> <img src="'.$prod_img_thumb.'" width="'.$new_width.'" heigt="'.$new_height.'"> </a>'; $titel = $_REQUEST['titel']; $sql = "INSERT INTO gallery (naam, album, extensie, thumb_extensie) VALUES ('".$titel."', '".$albumdir."', '".$userfile_name."', '".$prefix.$userfile_name."')";