I submit this:
http://www.webbywarehouse.com/members/thumb.php?img=fish.jpg&size=300&shadow=true
This is an edited updated post, I can now save the image but the resizer ONLY makes it square, how can I force it to allow x/y sizeing?
<?php
//thumbnail max size
//$size = 100;
//max additional size created by margin
$margin = 10;
//draw a border?
$border = false;
//draw a drop shadow?
//$shadow = true;
//where are the images?
$jpegdir = 'images';
//nothing else to configure
$jpeg = $jpegdir .'/'. $HTTP_GET_VARS['img'];
if($d=getimagesize($jpeg)){
$dim = ($d[1]>$d[0]) ? 1 : 0;
$mod = $size / $d[$dim];
$w = (int) ($d[0] * $mod);
$h = (int) ($d[1] * $mod);
$x = (int)(($size + $margin - $w) / 2);
$y = (int)(($size + $margin - $h) / 2);
//echo "<br>$w x $h";
//echo "<br>$x x $y";
header('Content-type: image/jpeg');
$src = imagecreatefromjpeg($jpeg);
$dst = imagecreate($size+($margin * 2), $size+($margin * 2));
$white = imagecolorallocate($dst,255,255,255);
imagefill($dst,0,0,$white);
if($border){
$black = imagecolorallocate($dst,0,0,0);
imagerectangle($dst,0,0,$size+$margin,$size+$margin,$black);
}
if($shadow){
$lighter = imagecolorallocate($dst,220,220,220);
imagefilledrectangle($dst,($x+3),($y+3),($w+$x+3),($h+$y+3),$lighter);
$light = imagecolorallocate($dst,180,180,180);
imagefilledrectangle($dst,($x+1),($y+1),($w+$x+1),($h+$y+1),$light);
$dark = imagecolorallocate($dst,140,140,140);
imagefilledrectangle($dst,($x),($y),($w+$x),($h+$y),$dark);
}
//imagecopyresampled($dst,$src,$x,$y,0,0,$w,$h,$d[0],$d[1]);
imagecopyresized($dst,$src,$x,$y,0,0,$w,$h,$d[0],$d[1]);
ImageJPEG($dst,"temp.jpg", 100);
imagejpeg($dst);
imagedestroy($dst);
imagedestroy($src);
echo $dist.'<br>'.$strlen($dst);
}
?>
[/COLOR]
Okay, the issue of saving is fixed, now how can I force the image to be resized by entering new x/y values. With this script as it is it only allows it to be a square. Hmmmmmmmmmmmm.
Last step then I am off and running.
What am I doing wrong?
I posted this in the "Newbie" forum, but thought that maybe it is supposed to be in this forum. Sorry for the repeat