wrproject Posted October 20, 2007 at 04:57 PM Report Share #141605 Posted October 20, 2007 at 04:57 PM ola pessoal, estou a precisar de gerar thumbnails para as iamgens que sao enviadas para o meu servidor. alguem sabe se existe alguma funcao/classe que permite redimensionar as imagens? agradeco a ajuda. Link to comment Share on other sites More sharing options...
LuRsT Posted October 20, 2007 at 05:33 PM Report Share #141611 Posted October 20, 2007 at 05:33 PM ola pessoal, estou a precisar de gerar thumbnails para as iamgens que sao enviadas para o meu servidor. alguem sabe se existe alguma funcao/classe que permite redimensionar as imagens? agradeco a ajuda. Também curtia de saber fazer isso. BotNet: The Game Tudo Sobre Formigas Link to comment Share on other sites More sharing options...
Betovsky Posted October 20, 2007 at 05:57 PM Report Share #141619 Posted October 20, 2007 at 05:57 PM ImageMagic "Give a man a fish and he will eat for a day; Teach a man to fish and he will eat for a lifetime. The moral? READ THE MANUAL !" Sign on a computer system consultant's desk Link to comment Share on other sites More sharing options...
joxnas Posted October 20, 2007 at 07:34 PM Report Share #141636 Posted October 20, 2007 at 07:34 PM ImageMagic E a alternativa é GD library .. Link to comment Share on other sites More sharing options...
wrproject Posted October 21, 2007 at 03:02 PM Author Report Share #141816 Posted October 21, 2007 at 03:02 PM vou usar mesmo a GD library, visto ser mais facil. ja agora deixo aqui o codigo para redimensionar imagens. <?php // File and new size $filename = 'test.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); ?> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now