From:             
Operating system: Open suse
PHP version:      5.3.10
Package:          GD related
Bug Type:         Bug
Bug description:Image produced on php-5.3.3. differs from same image roduced 
with php-5.2.5

Description:
------------
Image production with gdlib has changed between php 
php-5.2.5 and php-5.3.3. Run the attached test script on both versions to
see the 
difference. 

Test script:
---------------
<?php

$text = "abcdefghijklmnopqrstuvwxyz\n";
$text.= strtoupper("abcdefghijklmnopqrstuvwxyz")."\n";
$text .= "abcdefghijklmnopqrstuvwxyz\n";
$text.= strtoupper("abcdefghijklmnopqrstuvwxyz")."\n";
$text .= "abcdefghijklmnopqrstuvwxyz\n";
$text.= strtoupper("abcdefghijklmnopqrstuvwxyz")."\n";
$text .= "abcdefghijklmnopqrstuvwxyz\n";
$text.= strtoupper("abcdefghijklmnopqrstuvwxyz")."\n";

$text.= "01234567890123456789\n";
$text.= "!@#$%^&*()_+=-][}{\\|'\";:/?.>,<";

$fontdir = './';
putenv('GDFONTPATH='.$fontdir);
$font = 'verdana.ttf';

$box = imagettfbbox ( 7.5 , 0 , $font , $text );
$width = abs($box[4] - $box[0]);
$height = abs($box[5] - $box[1]);

// Create the image
$im = imagecreatetruecolor($width, $height);

// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, $width, $height, $white);

// Add the text
imagettftext($im, 7.5, 0, 1, 10, $black, $font, $text);

// Using imagepng() results in clearer text compared with imagejpeg()
// Set the content-type
header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);



-- 
Edit bug report at https://bugs.php.net/bug.php?id=61319&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=61319&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=61319&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=61319&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=61319&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=61319&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=61319&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=61319&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=61319&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=61319&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=61319&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=61319&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=61319&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=61319&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=61319&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=61319&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=61319&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=61319&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=61319&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=61319&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=61319&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=61319&r=mysqlcfg

Reply via email to