MadnessRed Posted June 19, 2008 Share Posted June 19, 2008 I have a basic image gallery. it works fine and I have made it fit in well with my site. There is only 1 problem, screenshots uploaded at 1280*1024 or even 1024 mess up everything because the table is only 778px wide. I don't know how I ended up with that width but it jsut seemed to fit all the images. Anyway here is what I want. How would I go about a script that said if ($imagewidth >770) { echo '<img src="screenshot.jpg" width="770" />'; } else { echo '<img src="screenshot.jpg" />'; } thanks Quote Link to comment Share on other sites More sharing options...
DarkWater Posted June 19, 2008 Share Posted June 19, 2008 You can get the width with getimagesize(). http://us2.php.net/getimagesize Quote Link to comment Share on other sites More sharing options...
MadnessRed Posted June 19, 2008 Author Share Posted June 19, 2008 ok, thanks, actually looking at the image gallery that will be impossible to force and also you don't get screenshots with a width less than 770 so i think I will force it to permanently 770 but thanks for the link, it will come in useful elsewhere. Quote Link to comment Share on other sites More sharing options...
Stephen Posted June 19, 2008 Share Posted June 19, 2008 Heres a good resizing script incase you need it: http://www.phpfreaks.com/forums/index.php/topic,191541.0.html Quote Link to comment 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.