Einzelnen Beitrag anzeigen
Alt 20.01.2008, 13:42   #4
void
Hero
 
Benutzerbild von void
 
Registriert seit: 26.07.2001
Ort: Wien
Beiträge: 811


Standard

hast du schon eine lösung? bei mir schaut das ungefähr so aus:
PHP-Code:
<?php
$height 
150;
$width 100;

$img $_GET['img'];
if(
file_exists($img))
{
    
$dim getimagesize($img);
    switch (
$dim[2]) {
      case 
2:
        
$cr imagecreatefromjpeg($img);
        break;
      case 
3:
        
$cr imagecreatefrompng($img);
        break;
      default:
        exit();
    }
    
header("Content-type: " image_type_to_mime_type($dim[2]));
    
$im imagecreatetruecolor($width$height);
    
// TODO: add random
    
$rnd_x 0;
    
$rnd_y 0;
    
imagecopy($im$cr000+$rnd_x0+$rnd_y$width+$rnd_x$height+$rnd_y);
    switch (
$dim[2]) {
      case 
2:
        
imagejpeg($im);
        break;
      case 
3:
        
imagepng($im);
        break;
    } 
    
imagedestroy($cr);
    
imagedestroy($im);
}
?>
____________________________________
nobody is perfect
void ist offline   Mit Zitat antworten