Kevin Pirnie' Articles

Need a good way to resize your uploaded image?   While keeping the height/width ratio? Why would you need to do this?  Well, like most of you, I did not need to keep full sized images that I upload on page, and needed a good way to create thumbnails, and resize the originals down to a more manageable, more web friendly size. This will do the trick...  no words of caution, no instructions, just code... use it how you like :) <?php function ResizeImage($inputFile, $filepath, $ext, $maxWidth, $maxHeight){ /* Get some details about the image */ $srcDetails = getimagesize($inputFile); switch ($srcDetails[2]) { case 1: //GIF $source_image = imagecreatefromgif($inputFile); break; case 2: //JPEG $source_image = imagecreatefromjpeg($inputFile); break; case 3: //PNG $source_image = imagecreatefrompng($inputFile); break; case 6: //WBMP… Read More
Today is an age of broadband. More and more people are going this route determined to experience the web and it's multitude of services as quick and painless as possible. Coupled with the move to broadband, more and more people are experiencing the web via their mobile devices, and it is this, that most developers/designers forget about. With mobile devices becoming more and more mainstream, it is more important than ever that we as designers, and developers imply the importance of optimized web sites to our clients. With this in mind, I would like to introduce some strategies I imply when developing a website, or web application. Optimize your images! Most clients now a days realize that most people are connecting to their site through… Read More