Bug #61319 [Opn->Fbk]: Image produced on php-5.3.3. differs from same image produced with php-5.2.5

From: Date: Wed, 07 Jan 2015 23:26:10 +0000
Subject: Bug #61319 [Opn->Fbk]: Image produced on php-5.3.3. differs from same image produced with php-5.2.5
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189721@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61319&edit=1

 ID:                 61319
 Updated by:         danack@php.net
 Reported by:        lior dot kuyer at gfk dot com
 Summary:            Image produced on php-5.3.3. differs from same image
                     produced with php-5.2.5
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            GD related
 Operating System:   Open suse
 PHP Version:        5.3.10
 Block user comment: N
 Private report:     N

 New Comment:

Neither of these versions is supported any more. 

If you think that the image generation is incorrect in a supported version, please can you let us
know, as well as providing the example image generated on your machine on a service like imgur.

For a lot of issues where images are generated incorrectly, the issue is dependent on your local
environment so providing the image you are seeing is required to allow the issue to be investigated.


Previous Comments:
------------------------------------------------------------------------
[2012-03-07 15:05:56] lior dot kuyer at gfk dot com

updated summary

------------------------------------------------------------------------
[2012-03-07 15:01:24] lior dot kuyer at gfk dot com

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 this bug report at https://bugs.php.net/bug.php?id=61319&edit=1


Thread (4 messages)

« previous php.bugs (#189721) next »