March 20, 200917 yr OK, I am currently working on making an image gallery for my blog but I am having problems with resizing the photos for thumbnails. This is a script I have at the moment which I wrote using a tutorial. <? $p = $_GET['p']; $w = $_GET['w']; $h = $_GET['h']; $ims = imagecreatefromjpeg("../gallery/images/$p"); $ow = imagesx($ims); $oh = imagesy($ims); $imd = imagecreate($w,$h); imagecopyresized($imd,$ims,0,0,0,0,$w,$h,$ow,$oh); //imagecopyresampled($imd,$ims,$0,$0,0,0,$w,$h,$ow,$ oh); header("Content-type: image/jpeg"); imagejpeg($imd); ?> And then I am displaying them with the following HTML code <img src=thumb.php?p=image.jpg&w=200&h=200> However this doesn't work as I would like it too. The images colour is badly distorted (like there is a filter layer over it) and some of them don't even display. Is there a better way I can do this? Preferably without GD, I don't think my host supports it.
March 20, 200917 yr Author Here is a link to the page I have so far. http://www.borellus.com/gallery/ so you can look for yourself. If you click the images it loads the origonal, as you can see the origonal files are fine. PROBLEM SOLVED! I was using imagecreate instead of imagecreatetruecolor.
Create an account or sign in to comment