Hey
Ik probeer via gd script een thumpball te maken via dit scriptje:
Nu krijg ik dit als thump:

Weet iemand wat ik fout doe?
Ik probeer via gd script een thumpball te maken via dit scriptje:
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
| list( $width, $height, $filetype, $dummy ) = getimagesize( $filename ); if ( $filetype != 2 && $filetype != 3 ) { // Limit to JPG or PNG files only echo("Kon geen thumpball maken (fout formaat).<br>\n" . $filetype . "<br>" . $filename); } else { $output = "/www/htdocs/chatstar/baby/fotos/thumps/" . $foto_name; $whratio = $width / $height; if ( $whratio > 1.0 ) { // Width is greater than height $newW = 200; $newH = 200 / $whratio; } else { // Height is greater than or equal to width $newW = 200 * $whratio; $newH = 200; } $dst = ImageCreate( $newW, $newH ); if ( $filetype == 2 ) { $src = ImageCreateFromJpeg( $filename ); } elseif ( $filetype == 3 ) { $src = ImageCreateFromPng( $filename ); } imagecopyresampled( $dst, $src, 0, 0, 0, 0, $newW, $newH, imagesx( $src ), imagesy( $src ) ); ImageJpeg( $dst, $output, 75 ); |
Nu krijg ik dit als thump:
Weet iemand wat ik fout doe?
www.dannyhiemstra.nl