[Linpha-cvs] SF.net SVN: linpha: [4559] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-08-27 13:14:22
|
Revision: 4559 Author: fangehrn Date: 2006-08-27 06:14:05 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/linpha/?rev=4559&view=rev Log Message: ----------- * fixed image rotate with gdlib Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/lib/classes/image/gdlib/image.php trunk/linpha2/lib/classes/image/gdlib/thumbnail.php trunk/linpha2/lib/classes/linpha.image.class.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-08-26 12:28:52 UTC (rev 4558) +++ trunk/linpha2/ChangeLog 2006-08-27 13:14:05 UTC (rev 4559) @@ -1,3 +1,6 @@ +2006-08-25 flo + * fixed image rotate with gdlib + 2006-08-26 bzrudi * fixed broken installation for postgres * replaced all PO_Inserted_ID (does not work with postgres) @@ -10,7 +13,6 @@ with this feature we should also be able to rotate images manually without having write permission to the file @todo what should happen if we later turn off autorot? - @todo why does it not work with gdlib?! 2006-07-15 flo * fixed bracket support detection during installation @@ -22,7 +24,6 @@ $array_output = array(); $return_value = ''; exec($str, $array_output, $return_value); - 2006-07-09 bzrudi * install: fixed bug in sqlite install - $_SESSION vars not inited and initial directories (sql/tmp/cache) under /var not created. Moved some functions to Modified: trunk/linpha2/lib/classes/image/gdlib/image.php =================================================================== --- trunk/linpha2/lib/classes/image/gdlib/image.php 2006-08-26 12:28:52 UTC (rev 4558) +++ trunk/linpha2/lib/classes/image/gdlib/image.php 2006-08-27 13:14:05 UTC (rev 4559) @@ -55,12 +55,8 @@ /** * rotate image - * @todo why does this not work?! */ - if(function_exists('imagerotate') AND $this->rotate != "0") - { - imagerotate($scaled_image,$this->rotate,0); - } + LinImage::imageRotateGd($scaled_image,$this->rotate); /** * save image Modified: trunk/linpha2/lib/classes/image/gdlib/thumbnail.php =================================================================== --- trunk/linpha2/lib/classes/image/gdlib/thumbnail.php 2006-08-26 12:28:52 UTC (rev 4558) +++ trunk/linpha2/lib/classes/image/gdlib/thumbnail.php 2006-08-27 13:14:05 UTC (rev 4559) @@ -86,12 +86,8 @@ /** * rotate image - * @todo why does this not work?! */ - if(function_exists('imagerotate') AND $this->rotate != "0") - { - imagerotate($scaled_image,$this->rotate,0); - } + LinImage::imageRotateGd($scaled_image,$this->rotate); /** * save image Modified: trunk/linpha2/lib/classes/linpha.image.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.image.class.php 2006-08-26 12:28:52 UTC (rev 4558) +++ trunk/linpha2/lib/classes/linpha.image.class.php 2006-08-27 13:14:05 UTC (rev 4559) @@ -576,6 +576,28 @@ readfile( $this->output_file ); } +/** + * rotates an image with a given angle using GDLib + * do nothing if imagerotate() doesn't exists + * + * + * @param imageressource $src_img pointer to the source image + * @param int $angle angle to rotate + * @author flo + * @todo maybe we should use linpha_log if imagerotate() doesn't exists + */ +function imageRotateGd(& $src_img, $angle) +{ + if(function_exists('imagerotate') && $angle != "0") + { + /** + * flip $angle, because with this function, left means right, and right means left :-) + */ + $angle = 360 - $angle; + $angle = $angle % 360; + $src_img = imagerotate($src_img,$angle,0); + } +} } // end class linImage ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |