mdmartiny Posted June 8, 2011 Share Posted June 8, 2011 Hey everyone, I am looking for a way to resize images for my website. I have been looking for a script, function, anything that works for a couple of days and nothing has seemed to work the way that I would like it. I am unfamiliar with resizing images using php so I am very confused and completely lost with all of this. I don't want to make a thumbnail and save it in a different directory. I have used the html width="150" height="200" not all of the images are the same size and it makes them look funny. Here is what I have written so far <a href="../../auto_images/<?php echo "$image"; ?>" rel="lightbox-scans"><img src="../../auto_images/<?php echo "$image"; ?>" width="150px" height="200px"/></a><br /> <div id="scans"> <?php if (!$image2 == "") { echo "<a href=\"../../auto_images/$image2\" rel=\"lightbox-scans\"><img src=\"../../auto_images/$image2\" width=\"30px\" height=\"50px\"/></a> "; } if (!$image3 == "") { echo "<a href=\"../../auto_images/$image3\" rel=\"lightbox-scans\"><img src=\"../../auto_images/$image3\" width=\"30px\" height=\"50px\"/></a>"; } ?> I am just looking for a simple way of doing this. Thank You Quote Link to comment https://forums.phpfreaks.com/topic/238790-resizing-images-on-the-fly/ Share on other sites More sharing options...
jcbones Posted June 8, 2011 Share Posted June 8, 2011 I've used simpleImage before, and found it easy to use. Great write ups as well. Quote Link to comment https://forums.phpfreaks.com/topic/238790-resizing-images-on-the-fly/#findComment-1226989 Share on other sites More sharing options...
fugix Posted June 8, 2011 Share Posted June 8, 2011 instead of using width: and height: you can either set images using a max-width: or max-height: . this will help to maintain the images proportions so you dont get an unproportional funny looking image Quote Link to comment https://forums.phpfreaks.com/topic/238790-resizing-images-on-the-fly/#findComment-1226993 Share on other sites More sharing options...
mdmartiny Posted June 8, 2011 Author Share Posted June 8, 2011 instead of using width: and height: you can either set images using a max-width: or max-height: . this will help to maintain the images proportions so you dont get an unproportional funny looking image I did not think of using that.. I did that and it worked perfect. Sometime it is the simplest anwers that you never think of Quote Link to comment https://forums.phpfreaks.com/topic/238790-resizing-images-on-the-fly/#findComment-1227010 Share on other sites More sharing options...
fugix Posted June 8, 2011 Share Posted June 8, 2011 instead of using width: and height: you can either set images using a max-width: or max-height: . this will help to maintain the images proportions so you dont get an unproportional funny looking image I did not think of using that.. I did that and it worked perfect. Sometime it is the simplest anwers that you never think of glad it gave you the result that you were looking for, everyone misses the little things sometimes,happens to all of us, if you could, please mark this thread as solved located in the bottom left hand of the page, thank you Quote Link to comment https://forums.phpfreaks.com/topic/238790-resizing-images-on-the-fly/#findComment-1227041 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.