eyeh8f8 Posted September 22, 2007 Share Posted September 22, 2007 First off i am new to php so this may be simple to some but not me. What i want to do is have it so when an image is submitted to my site it is at a fixed 88 by 31. Is there something i do with the sql or php or both. also I am trying to learn as much from this experience(making the script.) so could you give me just what i need to create that part of the script and no more. if i have anymore questions on this script, i will ask in this thread(of course there are other parts to the script) also if that seems rude or anything, sorry, i just want to say that i did some of the work on my own, and without asking a hundred billion questions. Quote Link to comment Share on other sites More sharing options...
Aeglos Posted September 22, 2007 Share Posted September 22, 2007 Take a look at the image functions in php, particullary: http://www.php.net/manual/en/function.imagecopyresampled.php and the related ones needed (imagejpg(), imagecreatetruecolor(), etc) There's a couple of examples that can help you work your way up from them. Alternatively, you can just use CSS to force the submited images to 81x33, although they will look ugly sometimes and will not save you server space. Hope that helps, Cheers. Quote Link to comment Share on other sites More sharing options...
eyeh8f8 Posted September 22, 2007 Author Share Posted September 22, 2007 oops i may have exlplained it wrong. but what I wanted it to do is make it so anything larger(or smaller) would not be allowed. although i will go to the link to see if it helps. I just think that should be clarified. Quote Link to comment Share on other sites More sharing options...
eyeh8f8 Posted September 22, 2007 Author Share Posted September 22, 2007 i couldn't find it, although the link was helpful with some other things. Quote Link to comment Share on other sites More sharing options...
Aeglos Posted September 22, 2007 Share Posted September 22, 2007 Then you can use getimagesize(). It's right in the examples, something like: <?php list($width, $height) = getimagesize($uploaded_image); if ( ($width > 81) || ($height > 33) ){ echo 'upload invalid'; }else{ do_upload_thingy(); } ?> 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.