note 85171 added to function.imagecopy

From: Date: Mon, 18 Aug 2008 21:23:25 +0000
Subject: note 85171 added to function.imagecopy
Groups: php.notes 
Request: Send a blank email to php-notes+get-143608@lists.php.net to get a copy of this message
Here is a simple function to rotate a non-square image 90 degrees clockwise. function rotateImage($imageResource) { $width = imagesx($imageResource); $height = imagesy($imageResource); $side = $width > $height ? $width : $height; $squareImage = imagecreatetruecolor($side, $side); imagecopy($squareImage,$imageResource,0,0,0,0,$width,$height); $squareImage = imagerotate($squareImage,270,0,-1); $imageResource = $squareImage; $imageResource = imagecreatetruecolor($height, $width); imagecopy($imageResource,$squareImage,0,0,0,0,$height,$width); return $imageResource; } ---- Server IP: 69.147.83.197 Probable Submitter: 67.128.33.98 ---- Manual Page -- http://www.php.net/manual/en/function.imagecopy.php Edit -- https://master.php.net/note/edit/85171 Del: integrated -- https://master.php.net/note/delete/85171/integrated Del: useless -- https://master.php.net/note/delete/85171/useless Del: bad code -- https://master.php.net/note/delete/85171/bad+code Del: spam -- https://master.php.net/note/delete/85171/spam Del: non-english -- https://master.php.net/note/delete/85171/non-english Del: in docs -- https://master.php.net/note/delete/85171/in+docs Del: other reasons-- https://master.php.net/note/delete/85171 Reject -- https://master.php.net/note/reject/85171 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#143608) next »