php resize image not working -


hello trying follow example php manual website. didnt work me. can help. installed gd on server.

<?php // file , new size $filename = 'test.jpg'; $percent = 0.5;  // content type header('content-type: image/jpeg');  // 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); ?> 


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -