el codigo que tengo es el siguiente
Código PHP:
<?php
if(isset($_GET['id'])) {
require("connect.php");
$sql = "SELECT * FROM table WHERE id='".$_GET['id']."'";
$consulta = mysql_query($sql,$SQLid);
$imagen = mysql_result($consulta,0,"blob");
Header ("Content-type: image/jpeg");
$img = imagecreatefromstring($imagen);
$picsize = $_GET['size'];
$new_w = imagesx($img);
$new_h = imagesy($img);
$aspect_ratio = $new_h / $new_w;
$new_w = $picsize;
$new_h = abs($new_w * $aspect_ratio);
if ($new_h > 400){
$aspect_ratio = $new_w / $new_h;
$new_h = 400;
$new_w = abs($new_h * $aspect_ratio);
}
$dst_img = ImageCreateTrueColor($new_w,$new_h);
imagecopyresampled($dst_img,$img,0,0,0,0,$new_w,$new_h,imagesx($img),imagesy($img));
imagejpeg($dst_img,'',100);
}
?>
1. int imagecolorallocate ( resource $image , int $red , int $green , int $blue )
y
2. imagecolorset ( resource $image , int $index , int $red , int $green , int $blue [, int $alpha = 0 ] )