diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 512ffd0ca..fba02e36a 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -3,6 +3,8 @@ - Fixed a problem with the slide panel where the links would sometimes take the properties of the style. - fix [ 1302878 ] testEnvironment.pl does not check versions (Wouter van Oijen / ProcoliX) + - fix [ 1238223 ] captcha image broken in WRE + - fix [ 1288783 ] Captcha picture only works with the latest ImageMagick. 6.7.5 diff --git a/lib/WebGUI/Storage/Image.pm b/lib/WebGUI/Storage/Image.pm index 9392339da..c5a9a99cf 100644 --- a/lib/WebGUI/Storage/Image.pm +++ b/lib/WebGUI/Storage/Image.pm @@ -62,12 +62,13 @@ sub addFileFromCaptcha { srand; $challenge.= ('A'..'Z')[rand(26)] foreach (1..6); my $filename = "captcha.".WebGUI::Id::generate().".png"; - my $image = Image::Magick->new; + my $image = Image::Magick->new(); $image->Set(size=>'105x26'); $image->ReadImage('xc:white'); - $image->Annotate(pointsize=>20, skewY=>5, skewX=>11, gravity=>'center', fill=>'black', antialias=>'true', text=>$challenge); - $image->Swirl(degrees=>10); - $image->AddNoise(noise=>'Multiplicative'); + $image->AddNoise(noise=>"Multiplicative"); + $image->Annotate(font=>$session{config}{webguiRoot}."/lib/default.ttf", pointsize=>30, skewY=>0, skewX=>0, gravity=>'center', fill=>'white', antialias=>'true', text=>$challenge); + $image->Blur(geometry=>"1"); + $image->Set(type=>"Grayscale"); $image->Border(fill=>'black', width=>1, height=>1); $image->Write($self->getPath($filename)); return ($filename, $challenge); diff --git a/lib/default.ttf b/lib/default.ttf new file mode 100644 index 000000000..11e6548ca Binary files /dev/null and b/lib/default.ttf differ