Resizing image without changing Aspect Ratio


I had written a piece of code like this. I’ve copied it below, use that code for your project..& gave your suggestion?





1) HTML => Code for file upload:
<form action=”upload.php”>

<input type=”file” name=”uploadFile” />

<input type=”submit” />


2) For DB image use below code to get a file





3) PHP => Code for get and resize image:

Filename : upload.php





$percent=$target_size/$width;  or  $percent=$target_size/$height;





Leave a Reply

Your email address will not be published. Required fields are marked *