PHP Classes

Rectangles

Recommend this page to a friend!

      Another CAPTCHA project  >  All threads  >  Rectangles  >  (Un) Subscribe thread alerts  
Subject:Rectangles
Summary:Rectangles instead of simbols
Messages:7
Author:Dmytro Zarezenko
Date:2006-10-04 21:05:02
Update:2006-10-07 07:33:21
 

  1. Rectangles   Reply   Report abuse  
Picture of Dmytro Zarezenko Dmytro Zarezenko - 2006-10-04 21:05:02
Hi, I got rectangles instead of simbols, what I must to do with this?

  2. Re: Rectangles   Reply   Report abuse  
Picture of László Zsidi László Zsidi - 2006-10-05 12:18:09 - In reply to message 1 from Dmytro Zarezenko
Hi,

First, to be sure installed truetype font in the specified directory, or try to download and use an updated main class from phpclasses.
I Found a fatal error on the original main class and updated.

László Zsidi

  3. Re: Rectangles   Reply   Report abuse  
Picture of László Zsidi László Zsidi - 2006-10-05 12:19:50 - In reply to message 1 from Dmytro Zarezenko
Can you send me a grabbed screen?

  4. Re: Rectangles   Reply   Report abuse  
Picture of Dmytro Zarezenko Dmytro Zarezenko - 2006-10-06 19:47:52 - In reply to message 3 from László Zsidi
Hi, You can see result for input string '123' and 'Verdana' font at http://www.zarezenko.vn.ua/demo/captcha/example.gif

  5. Re: Rectangles   Reply   Report abuse  
Picture of László Zsidi László Zsidi - 2006-10-06 21:10:37 - In reply to message 4 from Dmytro Zarezenko
Hi,

Seems to be the frames rendering and animated gif creating were ok.
The problem came from dynamic image creation.
Please check this script on your webserver and tell me the results:

<?php
$text = "123";
$var0 = "font.ttf"
$var1 = array ( );
$var1 = imageTTFBbox ( 22, 0, $var0, $text );
$timg = imageCreateTrueColor ( $var1[4] + 15, abs( $var1[5] ) + 15 );
$var2 = ImageColorAllocate( $timg , 0, 0, 0 );
$var3 = ImageColorAllocate( $timg , 192, 192, 192 );
imageFill( $timg , 0, 0, $var2 );
imagettftext( $timg , 22, 0, 7, abs( $var1[5] ) + 6, $var3, $var0, $text);
header ( 'Content-type:image/gif' );
imageGif ( $timg );
?>

  6. Re: Rectangles   Reply   Report abuse  
Picture of Dmytro Zarezenko Dmytro Zarezenko - 2006-10-06 23:07:04 - In reply to message 5 from László Zsidi
Hi, result on http://www.zarezenko.vn.ua/demo/captcha/example1.gif .

  7. Re: Rectangles   Reply   Report abuse  
Picture of László Zsidi László Zsidi - 2006-10-07 07:33:21 - In reply to message 6 from Dmytro Zarezenko
Hi,

Yes the problem came from ttf font renfering by imageTTFText() GD function.
Try to use an another truetype font and to make sure of freetype library installation on your webserver.

Regards