Edit report at https://bugs.php.net/bug.php?id=54520&edit=1

 ID:                 54520
 Comment by:         akger1379 at gmail dot com
 Reported by:        rpoca at androme dot es
 Summary:            Font in cifs mounted path causes "Could not read
                     font" error
 Status:             Open
 Type:               Bug
 Package:            GD related
 Operating System:   Linux Debian 6.0 Squeeze
 PHP Version:        5.3.6
 Block user comment: N
 Private report:     N

 New Comment:

I found a solution! It seems to be a problem of freetype...

Just mount the cifs with the "noserverinfo" option and it will work.

For more information:
https://savannah.gnu.org/bugs/?func=detailitem&item_id=31791

PS: I tried to write a comment to the linke above but I was not able to do so. 
Maybe someone else could push a bit to get this bug solved.


Previous Comments:
------------------------------------------------------------------------
[2011-04-13 12:40:37] rpoca at androme dot es

Description:
------------
Trying to open a .ttf file in a CIFS mounted share (644 file permissions) causes
PHP Warning:  imagefttext(): Could not read font in 
/var/www/whatever/whatever/morewhatever/whatever/whatever/test.php on line 23

I tried to create the attached script (which sets GDFONTPATH to the current 
dir) 
to have a test. When run from /tmp with all the font files in the same 
directory, 
it works.

But when I moved into a CIFS mounted webroot, it stops working. It also fails 
when 
executing from the command line, from apache, as root, etc.



Test script:
---------------
<?php
$cwd = getcwd();
putenv("GDFONTPATH=$cwd");
// Note: You can find DejaVuSans.ttf on /usr/share/fonts/truetype/ttf-dejavu/
// if you "apt-get install ttf-dejavu"
$font1 = 'DejaVuSans.ttf';
$image = imagecreate( 400, 400 );
$bgcolor = imagecolorallocate($image, 255, 0, 0);
$color = imagecolorallocate($image, 255, 255, 0);
imagefttext( $image, 10, 0, 100, 100, $color, $font1, 'Test1');
header("Content-Type: image/png");
imagepng($image);
imagedestroy($image);
?>


Expected result:
----------------
Both on a cifs mounted drive and a normal path you should get the PNG image 
with 
the "Test1" string.

Actual result:
--------------
# php test.php
PHP Warning:  imagefttext(): Could not find/open font in 
/var/www/phemiumconsultant/portals/consultant/runtime3g/layouts/fonts/test.php 
on 
line 12
...PNG... binary data...



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=54520&edit=1

Reply via email to