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

 ID:                 52403
 Updated by:         h...@php.net
 Reported by:        h...@php.net
 Summary:            imagettfbbox/imagettftext "Could not read font"
                     error
-Status:             Bogus
+Status:             Open
 Type:               Bug
 Package:            GD related
 Operating System:   CentOS4
 PHP Version:        5.2.13
 Block user comment: N

 New Comment:

To confirm,



"could not find/read font" means the file is not readable.



"Could not read font" means what?



And you don't believe these errors are ambiguous?



There is clearly an issue with the error being too ambiguous. The gain
would be to improve the end user experience.



Or are we to assume that improvements are no longer worth reporting?


Previous Comments:
------------------------------------------------------------------------
[2010-10-19 18:29:43] paj...@php.net

The error if the file does not exist or cannot be open is "could not
find/read font".



The error when GD cannot (actually Freetype failed) read the font file
is "could not read font", which is perfectly correct. There is no bug
here and I won't change this error (will have to change in external GD
as well, duplicate tests, etc. for no gain).

------------------------------------------------------------------------
[2010-10-18 22:20:55] h...@php.net

No, the message is ambiguous. Consider this...



If GD is able to read the file, it is readable.



If GD is unable to read the file, it is unreadable.



We know the file is readable, that is not the problem.



If GD is able to validate the file, it is valid.



If GD is unable to validate the file, it is invalid.



We do not know whether the file is valid or not.



Alternatively,



If GD is able to support the file, it is supported.



If GD is unable to support the file, it is unsupported.



We do not know whether the file is supported or not.



To use "read" is too ambiguous in this context.

------------------------------------------------------------------------
[2010-10-18 20:29:04] paj...@php.net

The message is correct. As some fonts are supported by some freetype
versions. It does not mean that the font file is invalid, but that ft
(gd) could not read it.

------------------------------------------------------------------------
[2010-10-18 18:32:39] h...@php.net

To put it very simply, it incorrectly says "Could not read font", when
it should say "Invalid font file".



Could somebody fix this or do you need me to supply a patch?

------------------------------------------------------------------------
[2010-07-27 14:56:55] h...@php.net

To clarify:



Expected result:

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

Warning: imagettfbbox() [function.imagettfbbox]: Invalid font file in
/home/share/www/dev/test/php/imagettfbbox.php on line 4



What PHP version? 5.2.13

Does font 'Vera.ttf' exist? Yes

Is font 'Vera.ttf' readable? Yes



Actual result:

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

Warning: imagettfbbox() [function.imagettfbbox]: Could not read font in
/home/share/www/dev/test/php/imagettfbbox.php on line 4



What PHP version? 5.2.13

Does font 'Vera.ttf' exist? Yes

Is font 'Vera.ttf' readable? Yes

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


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/bug.php?id=52403


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

Reply via email to