Pollus - 2009-05-20 10:15:34 -
In reply to message 2 from Pollus
actually, change the whole funtion save_photo to:
function save_photo(){
imagesetthickness($this->photo,1);
if($this->browser) {
header('Content-type: image/'.($this->ext == '.jpg' ? 'jpeg' : substr($this->ext,1)));
header('Content-Transfer-Encoding: binary');
header('Content-Disposition: inline; filename='.basename($this->file));
header("Cache-control: private");
switch($this->ext){
case ".jpeg":
case ".jpg":
imagejpeg($this->photo, NULL , 85 ) or die ( 'no image' );
break;
case ".gif":
imagegif($this->photo) or die ( 'no image' );
break;
case ".png":
imagepng($this->photo) or die ( 'no image' );
break;
}
} else {
switch($this->ext){
case ".jpeg":
case ".jpg":
imagejpeg($this->photo, "$this->path$this->file", 85 ) or die ( 'You do not have permission to write in this folder!' );
break;
case ".gif":
imagegif($this->photo, "$this->path$this->file" ) or die ( 'You do not have permission to write in this folder!' );
break;
case ".png":
imagepng($this->photo, "$this->path$this->file" ) or die ( 'You do not have permission to write in this folder!' );
break;
}
}
$this->outfile=$this->path.$this->file;
$this->file=strrchr("/",$this->file);
}