Status of MagickWand for PHP

MagickWand for PHP is an object-oriented PHP interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning MagickWand for PHP.
Post Reply
tsr

Status of MagickWand for PHP

Post by tsr »

Hi,

Ok, I'm building a simple image editor for use in a web-browser. Currently I'm not very confident in using IM or MagickWand, but I'm getting there :)

What I would like to know is the status of the MagickWand module for PHP. How actively is it maintained, etc.

The reason I'm asking is because I'm trying to create a simple shadow-command and while there is a quite good shadow-option for the CLI and also the C API (as seen here) I wonder what it will take to get it into PHP MagickWand (or maybe it's allready there, just not documented?)

[edit]It appears that the problem is with the documentation at http://www.magickwand.org that just doesn't mention the Shadow-function. So I'd like to rephrase my question: who is in charge of that site and how can I get in touch with them so that the documentation is up to date.[/edit]

I also wonder if there are any image manipulating libraries that are based on PHP MagickWand? (to see example code that is written in PHP)

/tsr
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Status of MagickWand for PHP

Post by magick »

MagickWand for PHP is actively maintained. We just release MagickWand for PHP 1.0.0 just a week or so ago.

We'll add a method for shadows in the next point release.
nunz

Re: Status of MagickWand for PHP

Post by nunz »

You get the honor of getting my first reply ever!

Here's some code that I wrote that makes a text shadow. Everything in $CAPITAL_LETTERS is defined earlier in the PHP file. Let me know if this helps.

I'm brand new to using Magickwand-- so I may not be a lot of help (that's just a disclamer). :lol:

Code: Select all

	if ($MESSAGE != "")
	{
		$font_color_wand = setColor( $FONT_COLOR );
	
		DrawSetTextAlignment( $brush, MW_CenterAlign );	//set drawn text properties.
		DrawSetGravity( $brush, MW_CenterGravity );
		DrawSetFont( $brush, $FONT );
		DrawSetFontSize( $brush, $FONT_SIZE );
		DrawSetStrokeWidth( $brush, 1 );
	
		$txt_offset = ($FONT_SIZE / 2) * substr_count( $MESSAGE, "\n" );
	
		if ($FONT_SHADOW)
		{
			$font_shadow_wand = NewPixelWand();
			$color_arr = PixelGetQuantumColor( $font_color_wand );
	
			$color_arr['r'] -= $color_arr['r'] * $FONT_SHADOW_INTENSITY;
			$color_arr['g'] -= $color_arr['g'] * $FONT_SHADOW_INTENSITY;
			$color_arr['b'] -= $color_arr['b'] * $FONT_SHADOW_INTENSITY;
		
			PixelSetQuantumColor( $font_shadow_wand, $color_arr['r'], $color_arr['g'], $color_arr['b'] );
			DrawSetFillColor( $brush, $font_shadow_wand );
			DrawSetStrokeColor( $brush, $font_shadow_wand ); 
			DrawAnnotation( $brush, ($WIDTH / 2) + $FONT_SHADOW_OFFSET, ($HEIGHT / 2) - $txt_offset + $FONT_SHADOW_OFFSET, $MESSAGE );	
	
		}
		DrawSetFillColor( $brush, $font_color_wand );
		DrawSetStrokeColor( $brush, $font_color_wand ); //sets the stroke color to $FONT_COLOR.
	
		DrawAnnotation( $brush, ($WIDTH / 2), ($HEIGHT / 2) - $txt_offset, $MESSAGE );
	}
Post Reply