Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preserve transparency after rotate

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
GB
The rotation and display work on this small script but how do I keep transparency. According to the docs there is a 4th var in the rotate command to control transparency but however I add the var the script throws an error. (too many vars)

Code:
<?php
ini_set('display_errors',1); 
error_reporting(E_ALL|E_STRICT); 

$img_name='images/dirarr2.png';
$Rotat=45;
$Rotat=360-$Rotat;
$src_img = ImageCreateFrompng($img_name);
$BackCuller = imagecolorallocate($src_img, 0,0,0);

[red]$Rotate=imagerotate ($src_img , $Rotat, $BackCuller);[/red]

Imagepng($Rotate);

ImageDestroy($src_img);

?>

Keith
 
Hi

audiopro said:
According to the docs there is a 4th var in the rotate command to control transparency but however I add the var the script throws an error. (too many vars)
PHP said:
[navy]Changelog[/navy]
[tt][highlight #9999CC] Version [/highlight][/tt] [tt][highlight #9999CC] Description [/highlight][/tt]
[tt][highlight #F0F0F0] 5.1.0 [/highlight][/tt] [tt][highlight #F0F0F0] ignore_transparent was added. [/highlight][/tt]
Then you have PHP older than 5.1.0.

Feherke.
 
it's certainly 'below' version 5.1.0...

what host do you use?
 
The host is Easyspace.
I have contacted them and they explain that if they updated PHP, many of the scripts on the shared server would fall over which I suppose is fair comment. I have other domains with them which are on newer servers with later versions of software. I can use those for the odd rotating job.

Keith
 
many hosts install both versions of php and allow you to choose through use of .htaccess files.

it is unlikely that scripts will fall over when migrating from php4 to php5. there are very few functions that are not backwards compatible from php5. Yes, some scripts will error but i would guess much less than 1%.

just fyi here is the list of backward incompatibility. and some of these are not true incompatibilities but simply behaviour changes.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top