ted_chou12 Posted January 8, 2007 Share Posted January 8, 2007 Can you restrict the image display size using php? Quote Link to comment https://forums.phpfreaks.com/topic/33379-solved-restrict-image-display-size/ Share on other sites More sharing options...
Jessica Posted January 8, 2007 Share Posted January 8, 2007 Vague Question.Look at some php image tutorials. Google is this awesome tool, you type what you want in it, and it finds relevant pages. If I type "PHP Image Size" I get some awesome info on PHP and Image Sizes. Quote Link to comment https://forums.phpfreaks.com/topic/33379-solved-restrict-image-display-size/#findComment-155988 Share on other sites More sharing options...
ted_chou12 Posted January 8, 2007 Author Share Posted January 8, 2007 I tried, I found a css script, doesnt work, so i want to try php, I know the image get size function, but how do you set it? because if you determine one side, such as the height, and leave the width, wide pictures will make it go crazy still. But if you fix both, then the ratio changes, so I dont know how should you use php to achieve it.Ted Quote Link to comment https://forums.phpfreaks.com/topic/33379-solved-restrict-image-display-size/#findComment-155991 Share on other sites More sharing options...
Jessica Posted January 8, 2007 Share Posted January 8, 2007 That's amazing that searching for PHP Image Size returned only CSS. I tried it just now and got a plethora of wonderful results of PHP. No CSS, wow.Maybe your google is like, broken? omg. Quote Link to comment https://forums.phpfreaks.com/topic/33379-solved-restrict-image-display-size/#findComment-156005 Share on other sites More sharing options...
ted_chou12 Posted January 8, 2007 Author Share Posted January 8, 2007 ...$imgsize = getimagesize("images/photo/photo". $r['id'] .".jpg");while ($imgsize[0] > 300 or $imgsize[1] > 100) {$width = ($imgsize[0]/10);$length = ($imgsize[1]/10);}this is what I have got so far, $r['id'] is the variable which points to the picture, but when I inserted this code, the page below doesnt show up at all, and no errors display... Quote Link to comment https://forums.phpfreaks.com/topic/33379-solved-restrict-image-display-size/#findComment-156008 Share on other sites More sharing options...
Jessica Posted January 8, 2007 Share Posted January 8, 2007 || is 'or' in php.TUTORIALS FOR THE LOVE OF PETE PLEASE GO READ SOME MORE. Quote Link to comment https://forums.phpfreaks.com/topic/33379-solved-restrict-image-display-size/#findComment-156013 Share on other sites More sharing options...
ted_chou12 Posted January 8, 2007 Author Share Posted January 8, 2007 or works well, like and, i dont prefer to use symbol because if I skem through quickly, using english, i wouldnt have to slow down in order to understand my code. btw. I found what the problem was.ThanksTed Quote Link to comment https://forums.phpfreaks.com/topic/33379-solved-restrict-image-display-size/#findComment-156020 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.