designanddev Posted November 11, 2012 Share Posted November 11, 2012 Ok, im new to php and trying to develop an app that allows me to upload image then resize them only on the output, i managed to save the image on the server in a folder, now i want to be able to display this images on the site in different sizes depending on what part of the site. like thumbnails and a bigger scale ect... so far i have this code $image_properties = getimagesize("uploads/orders.jpg"); $image_width = $image_properties[0]; $image_height = $image_properties[1]; $image_ratio = $image_width / $image_height; echo"<img src=\"$image_ratio\">"; here i trying to divide the image by half... i no im a long way off i thought this would work due to retrieving the image size properties then dividing it by half, then echoing it out in an image tag, haha.... eventually i would like to master this and be able to change the size by assigning numbers to variable, keeping the size proportions. help on this topic would be great, i serious need it breaking down, am i far off? Kind Regards Quote Link to comment https://forums.phpfreaks.com/topic/270567-image-resizing-with-php/ Share on other sites More sharing options...
MMDE Posted November 11, 2012 Share Posted November 11, 2012 (edited) Do you want to do this because of bandwidth to the server? If this is not the case, then you can use HTML and CSS for this. http://dev.w3.org/ht...markup/img.html If you really want to re-size it to save bandwidth, then you need to use one of the image processing libraries in PHP, here's a good list of some of them: http://www.php.net/m...lspec.image.php I've only really used GD: http://www.php.net/m.../book.image.php I know it can do what you are asking for and there should be lots of tutorials for it online. Edited November 11, 2012 by MMDE Quote Link to comment https://forums.phpfreaks.com/topic/270567-image-resizing-with-php/#findComment-1391723 Share on other sites More sharing options...
designanddev Posted November 11, 2012 Author Share Posted November 11, 2012 thanks for the reply il take a look Quote Link to comment https://forums.phpfreaks.com/topic/270567-image-resizing-with-php/#findComment-1391745 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.