note 45883 added to function.imagerotate

From: Date: Wed, 22 Sep 2004 13:43:04 +0000
Subject: note 45883 added to function.imagerotate
Groups: php.notes 
Request: Send a blank email to php-notes+get-77152@lists.php.net to get a copy of this message
Very high speed 90 degree rotating loop <?php $src = imagecreatefromjpeg('src.jpg'); $sx = imagesx($src); $sy = imagesy($src); $dst = imagecreatetruecolor($sy,$sx); imagepalettecopy($dst,$src); for ($x = 0 ; $x < $sx ; $x++) for ($y = 0 ; $y < $sy ; $y++) imagesetpixel($dst,$y,$x,imagecolorat($src,$x,$y)); header("Content-Type: image/jpeg"); imagejpeg($dst); ?> Or the other direction: <?php $src = imagecreatefromjpeg('src.jpg'); $sx = imagesx($src); $sy = imagesy($src); $dst = imagecreatetruecolor($sy,$sx); imagepalettecopy($dst,$src); for ($x = 0 ; $x < $sx ; $x++) for ($y = 0 ; $y < $sy ; $y++) imagesetpixel($dst,$sy - $y - 1,$sx - $x - 1,imagecolorat($src,$x,$y)); header("Content-Type: image/jpeg"); imagejpeg($dst); ?> ---- Manual Page -- http://www.php.net/manual/en/function.imagerotate.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+45883 Delete -- http://master.php.net/manage/user-notes.php?action=delete+45883&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+45883&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#77152) next »