function imageapi_imagemagick_image_overlaytext_alpha(&$image, $text, $size = 12, $x = 0, $y = 0, $RGB, $fontfile = 'MgOpenModernaBold', $angle = 0)
{
if ( $angle <> 0 )
$image->ops[] = " -rotate ".$angle." -pointsize ".$size." -fill rgb(".$RGB['red'].','.$RGB['green'].','.$RGB['blue'].") -draw \"text ".$x.",".$y." 'Hello'\" -rotate '.-($angle).";
else
$image->ops[] = " -pointsize ".$size." -fill rgb(".$RGB['red'].','.$RGB['green'].','.$RGB['blue'].") -draw \"text ".$x.",".$y." 'Hello'\" ";
return true ;
}
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | textactions.inc-imagemagick-6.7.x.patch | 800 bytes | bgilhome |
| #6 | 359339.patch | 803 bytes | fax8 |
Comments
Comment #1
erik seifert commentedProblems are only with the angle and positioning ( because i must rotate the whole image then write a text and rotae it back ).
Comment #2
bismigalis commentedWow man, thanx, it's what I need right now!!!
I only wrapped rgb() in doblequote, otherwise it dont worked.
Comment #3
fax8 commentedI'm currently using this:
Place the above in textactions.inc.
Notice that I escaped with \ the ( and ), used $text instead of Hello and added + 50 to the $x value.. yes.. this is very hacky but that's what was needed to place the text where I needed it to be.
Hope this helps someone,
Fabio Varesano
Comment #4
2ndmile commented@fax8 - Thanks for this. I needed to use ImageMagick for the PDF_to_ImageField module so this came in handy. I did get the following error when trying to use an angle.
ImageMagick reported an error: sh: -c: line 0: unexpected EOF while looking for matching `'' sh: -c: line 1: syntax error: unexpected end of fileBut for this project using the angle is not a big deal so I emptied the field and it worked as expected.
Comment #5
Andrey Zakharov commentedWith support of rotating.
Rotates relative to bottom left point of text box.
Comment #6
fax8 commentedConverted Andrey Zakharov code into a proper patch. Tested with 6.x-1.8.
Now, can we have some maintainer attention? Thanks.
Comment #7
fax8 commentedComment #8
bgilhome commentedNot sure if it's a ImageMagick 6.7.x change but the patch in #6 didn't apply opacity properly - here's an updated patch.
Comment #9
ryan_courtnage commented#6 works with ImageMagick-6.5.4.7-6.el6_2.x86_64. (#8 doesn't)
Comment #10
fietserwinD6 EOL. This module's D6 issues already haven't received any attention for over a year. Closing them all unconditionally now.