Drompo
24-08-2007, 08:08 PM
I have this code
<?php
session_start();
?>
<?php
// File and new size
$path = $_SESSION['path'];
$filename = $path;
// Content type
header('Content-type: image/png');
// Get new sizes
list($width, $height) = getimagesize($filename);
$newvalues = $_SESSION['newvalues'];
$explode = explode('x', $newvalues);
$newwidth = $explode[0];
$newheight = $explode[1];
// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefrompng($filename);
// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
// Output
imagepng($thumb);
?>
But it only outputs loads of ascii symbols
<?php
session_start();
?>
<?php
// File and new size
$path = $_SESSION['path'];
$filename = $path;
// Content type
header('Content-type: image/png');
// Get new sizes
list($width, $height) = getimagesize($filename);
$newvalues = $_SESSION['newvalues'];
$explode = explode('x', $newvalues);
$newwidth = $explode[0];
$newheight = $explode[1];
// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefrompng($filename);
// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
// Output
imagepng($thumb);
?>
But it only outputs loads of ascii symbols