You can change width and height of image when you upload image in database using this code:
Example code is here:
<?php $filename = time() .$_FILES["image_file"]["name"]; move_uploaded_file($_FILES['image_file']['tmp_name'],'uploads/our_members/'.$filename); // --- call this function -- // store_uploaded_image($filename,200,250); // --- declared this function -- // function store_uploaded_image($html_element_name, $new_img_width, $new_img_height) { // --- Include this file in your project folder -- // include('imageCheck.php'); $target_dir = "uploads/our_members/"; $target_file = $target_dir .$html_element_name; $image = new SimpleImage(); $image->load($target_file); $image->resize($new_img_width, $new_img_height); $image->save($target_file); return $target_file; //return name of saved file in case you want to store it in you database or show confirmation message to user } ?>
Question and answer is powered by AnsPress.io