heb de volgende code gemaakt om een plaatje te resizen en weg te schrijven..
alleen werkt hij nog niet helemaal... ik krijg hem niet verplaatst naar een dir en daarbij resized.
wat doe ik hier fout ? zit hier al een avond naar te kijken..beetje frusti
alleen werkt hij nog niet helemaal... ik krijg hem niet verplaatst naar een dir en daarbij resized.
PHP:
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
38
39
40
41
42
43
44
45
46
47
48
| <?php header("Content-type: image/JPEG"); // We maken een GIF/PNG image... $path="d:/www/godsdept.nl/www/nice.jpg"; if (isset($path)){ $size = GetImageSize ($path); }else{ $path="d:/www/godsdept.nl/www/nice.jpg"; } $new_w=round(120 * ($size[0] / $size[1]) ); $new_h=120; $dst_img=imagecreatetruecolor ($new_w,$new_h); $size; if($size[2]==1){ $src_img=ImageCreateFromGif($path); }else{ $src_img=ImageCreateFromJPEG($path); } ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img)); if (function_exists("imagegif")) { header ("Content-type: image/gif"); //imagegif ($dst_img); imagegif($dst_img,'d:/www/godsdept.nl/www/img/upload/nice.gif'); } elseif (function_exists("imagepng")) { header ("Content-type: image/png"); imagepng($dst_img,'d:/www/godsdept.nl/www/img/upload/nice.png'); //imagepng ($dst_img); } elseif (function_exists("imagejpeg")) { header ("Content-type: image/jpeg"); //imagejpeg ($dst_img, "", 50); // zet de file $dist_img op scherm Imagejpeg($dst_img,'d:/www/godsdept.nl/www/img/upload/nice.jpg'); } elseif (function_exists("imagewbmp")) { header ("Content-type: image/vnd.wap.wbmp"); //imagewbmp ($dst_img); Imagewbmp($dst_img,'d:/www/godsdept.nl/www/img/upload/nice.wbmp'); } else { die("No image support in this PHP server"); } ?> |
wat doe ik hier fout ? zit hier al een avond naar te kijken..beetje frusti
| www.everythingisspiritual.com | www.mosaic.org |