Slowly going insane over this.
This is my resize function:
function imageresize($img, $thumb, $thumb_width, $thumb_height)
{
$ext=explode('.',$img); // Isolere exstension
$ext=strtolower($ext[count($ext)-1]); // Gjere CAPS til lower.
echo "$ext";
if($ext == jpg)
{
$src_img = imagecreatefromjpeg("$img");
$dst_img = imagecreatetruecolor($thumb_width,$thumb_height);
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_width, $thumb_height, 0, 0);
imagejpeg($dst_img, "$thumb", 15);
imagedestroy($src_img);
imagedestroy($dst_img);
}
}
This is the code i'm calling the function with:
copy($imagefile, "$uname/$imagefile_name");
imageresize("$uname/$imagefile_name", "$uname/thumbs/$imagefile_name", 25, 25);
No errors...just a completly black image, thus empty.
Why on earth is this happening? Can anyone spot an error in my code, cos' i sure can't at this hour.