Loop vast op mijn resizer, de breedte en hoogte van het nieuw gemaakte image kloppen wel, maar het plaatje wordt zwart. Uiteraard alle vars al nagekeken en geprint, ze kloppen allemaal...
Dus blanco image maken gaat goed, maar dan.. weet iemand wat ik verkeerd doe ?
Dus blanco image maken gaat goed, maar dan.. weet iemand wat ik verkeerd doe ?
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
| <? class resize_image { ## Variabelen var $sourcefile; var $sourcefile_id; var $sourcefile_width; var $sourcefile_height; var $newheight; var $newwidth; var $dst_img; function set_sourcefile($sourcefile) { $this->sourcefile = $sourcefile; } function set_newheight($newheight) { $this->newheight = $newheight; } function resize() { $this->sourcefile_id = imageCreateFromJPEG($this->sourcefile); $this->sourcefile_width = imagesx($this->sourcefile_id); $this->sourcefile_height = imagesy($this->sourcefile_id); $this->newwidth = floor(($this->newheight / $this->sourcefile_height) * $this->sourcefile_width); //Blanco image maken met goede formaat $this->dst_img = imagecreatetruecolor($this->newwidth,$this->newheight); imagecopyresampled($this->dst_img,$this->sourcefile_id,0,0,0,0,$this->new_width,$this->new_height,$this->sourcefile_width,$this->sourcefile_height); //Image opslaan ImageJPEG($this->dst_img,"$this->sourcefile"); //Geheugen op schonen imagedestroy($this->dst_img); imagedestroy($this->sourcefile_id); } } ?> |
[ Voor 5% gewijzigd door Verwijderd op 19-05-2004 16:38 ]