[Sessions] Session + Serialize + Objets?
Bonjour,
j'ai un petit problème tout simple :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
class buffer {
var $im,$bg,$width,$height;
function buffer($width1,$height1) {
$this->width=$width1;
$this->height=$height1;
$this->im = @imagecreate($this->width, $this->height);
$this->bg = imagecolorallocate($this->im, 0, 255, 255);
}
function draw(){
ImagePNG($this->im, "image1.png");
}
} |
quand je sérialize cette objet:
Code:
1 2 3
|
$_SESSION['test'] = serialize(new buffer(640,480);
$test = unserialize($_SESSION['test']); |
il à l'air de perdre l'espace mémoire réservé par:
Code:
1 2
|
$this->im = @imagecreate($this->width, $this->height); |
concrètement il me donne une erreur sur la ligne:
Code:
1 2
|
ImagePNG($this->im, "image1.png"); |
invalid image ressource....
je ne sais pas si j'ai été assez clair...
mais comment remédier a ce problème?
merci d'avance.