Support » Plugins and Hacks » image-size php script wont work with my theme

  • hi,
    when i paste this php-script into my single.php
    it won’t work…
    why?…as standalone it works perfect

    <?php
    // File and new size
    $filename = 'http://www.multistorey.net/images/themselves2.jpg';
    $percent = 0.5;
    
    // Content type
    header('Content-type: image/jpeg');
    
    // Get new sizes
    list($width, $height) = getimagesize($filename);
    $newwidth = $width * $percent;
    $newheight = $height * $percent;
    
    // Load
    $thumb = imagecreatetruecolor($newwidth, $newheight);
    $source = imagecreatefromjpeg($filename);
    
    // Resize
    imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
    
    // Output
    imagejpeg($thumb);
    ?>
  • The topic ‘image-size php script wont work with my theme’ is closed to new replies.