ID:               26635
 User updated by:  choinet at rocketmail dot com
 Reported By:      choinet at rocketmail dot com
-Status:           Closed
+Status:           Open
 Bug Type:         GD related
 Operating System: Windows XP
-PHP Version:      4CVS-2003-12-24
+PHP Version:      4CVS-2003-12-28
 New Comment:

What am I doing wrong, then? Here's a screenshot at
http://icandy.sourceforge.net/phperror.gif, showing the script and font
file in c:\htdocs and c:\htdocs\test directory, respectively, as well
as the source code and the instance of the problem.

The warning was generated on Windows XP and Apache2 using the latest
STABLE CVS (I also checked 4.3.4, latest 5.x CVS, and 5.0.0 beta 3)


Previous Comments:
------------------------------------------------------------------------

[2003-12-28 14:24:51] [EMAIL PROTECTED]

I have tried path with spaces in them on Windows XP and they work
properly.

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

[2003-12-26 01:34:05] choinet at rocketmail dot com

When I read the previous response, I was almost completely baffled. I
see two confirmations that the bug has been fixed, yet here I am at my
computer with clean installs of the various PHP4,PHP4 CVS, PHP5 beta 3,
and PHP5 CVS, and still have the problem. I even went to my other
computer running Windows XP/Apache2/PHP to verify that I wasn't
encountering an isolated problem. Still, I found it quite odd that the
bug was fixed by the developers and that the bug was unreplicable.

Then I remembered having to place NetPBM binaries in a directory like
"c:\netpbm" without any spaces in the pathname in order for a
php-powered gallery application to recognize them. I decided to try the
same thing with the Apache DocumentRoot directive and set it to the
location of a copy of the test script, "C:/htdocs", instead of the
usual "C:/Program Files/Apache Group/Apache2/htdocs". After restarting
the server, the pathnames worked fine just like Iliaa described.

So, I found that the culprit (spaces in the pathname) affected not only
the absolute pathnames but the relative ones as well. For the absolute
pathnames, if they contain spaces, the same error in opening the font
will occur. This can only be remedied by using the MS-DOS 8.3
convention, e.g. "C:/Progra~1/Apache~1/Apache2/htdocs/arial.ttf" as
aforementioned. However, there is no such alternative for Linux
pathnames with spaces in them. Furthermore, concerning relative
pathnames, which much of the responses have been centered around: the
fonts work as intended when called as 'arial', 'arial.ttf', and so on
only if the directory containing them has no spaces in its pathname.
I'm not sure why the naming format of the parent directories affects
the relative pathname, but it somehow does. That is why the two gd
functions work only when the font file is located in a pathname without
spaces (c:\htdocs) and does not for the other (c:\Program Files\Apache
Group\Apache2\htdocs). So, I think that the problem of spaces is
affecting all of the other remaining issues.

I am assuming that the developers reported no problems on the Windows
setup because the http document root's or the fontfile's pathname had
no spaces. The thing is, the Apache webserver installs by default at
"c:\Program Files\Apache Group", so the DocumentRoot will still
generate this error.

Sorry for making this report seem long and drawn out, but the problem
has finally been pinpointed after much obfuscation, and I am wondering
if the outstanding issues can be fixed.

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

[2003-12-25 13:56:59] [EMAIL PROTECTED]

Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php

Neither Jani (sniper) nor I could replicate the bug on 
Win32 or Linux. The font checking code works with full 
paths, font name (without extension) and font name with 
extension. 

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

[2003-12-24 15:59:49] choinet at rocketmail dot com

sniper states that the bug has been fixed and such changes should be
reflected within the STABLE CVS in due time. However, there must have
been a mistake in the determination of the status. If he/she is
referring to the initial fix that has been made by iliaa, I am still
reporting problems with that, for I am sure that such changes have been
reflected in the latest snapshot, and it has been a little over a week
now since word of the fix. This seems to be the case, as there, indeed,
has been a change in the CVS to accomodate relative pathnames.

However, the fix is still incomplete, as one may not directly list the
complete relative pathname of the fontfile, only 'filename' (instead of
'filename.ext'). This is a problem if the filename does not have the
extension .pfa, .pfb, or .ttf (which I saw from the source code in
gdft.c). In addition, there is no way to open a fontfile named 'arial',
for example, if it does not have a file extension. Again, the other
three extensions that can be opened must be referred to by the basename
without the extension.

This problem is reproducible by using imagettftext(font resource, font
size, font angle, x-coordinate, y-coordinate, color resource, fontfile,
"Hello World"); where the file is named 'arial.ttf' and the argument
pathname is 'arial.ttf', or where the file is named 'arial' and the
argument pathname is 'arial' as well.

I would appreciate it if one of the PHP developers clarified whether
the STABLE CVS snapshots do not, in fact, reflect any pertinent fixes,
whether the bug will be fixed later, or if it simply cannot be fixed at
all as well as verified the existence of the problem in either of these
two instances. And trust me, this report will not be opened again once
the issue is cleared up.

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

[2003-12-20 15:18:59] choinet at rocketmail dot com

Please update the snapshots.

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/26635

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

Reply via email to