Bug #52404 [Com]: All TTF Files are invalid [ALL PHP.NET]

From: Date: Mon, 12 Dec 2011 18:43:14 +0000
Subject: Bug #52404 [Com]: All TTF Files are invalid [ALL PHP.NET]
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-165824@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=52404&edit=1 ID: 52404 Comment by: hm2k@php.net Reported by: hm2k@php.net Summary: All TTF Files are invalid [ALL PHP.NET] Status: Open Type: Bug Package: *General Issues PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Comment: ------------ I was unable to replicate clockwerx's findings. According to my results there is only a problem with the fonts changed by rasmus in r284292. New test script: ------------ <?php $fonts=array(); //from https://github.com/pear/Image_Text/raw/master/tests/Vera.ttf $fonts[]='fonts/Vera.ttf'; //from http://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/1.10/ttf- bitstream-vera-1.10.zip $fonts[] = 'fonts/ttf-bitstream-vera-1.10/Vera.ttf'; foreach ($fonts as $font) { $read = file_exists($font)?'Yes':'No'; echo "Does font '$font' exist? $read\n<br>"; $read = is_readable($font)?'Yes':'No'; echo "Is font '$font' readable? $read\n<br>"; $test = @imagettfbbox(1, 1, $font, 1)?'Yes':'No'; echo "Is font '$font' valid? $test\n<br>"; echo "What PHP version? ".phpversion()."\n<br>"; echo "\n<br>"; } ?> Results: ------------ Here's the results of that: Does font 'fonts/Vera.ttf' exist? Yes Is font 'fonts/Vera.ttf' readable? Yes Is font 'fonts/Vera.ttf' valid? No What PHP version? 5.3.4 Does font 'fonts/ttf-bitstream-vera-1.10/Vera.ttf' exist? Yes Is font 'fonts/ttf-bitstream-vera-1.10/Vera.ttf' readable? Yes Is font 'fonts/ttf-bitstream-vera-1.10/Vera.ttf' valid? Yes What PHP version? 5.3.4 Conclusion: ------------ In r284292 rasmus made a change which changed the EOL of these font files. These files use a "Mixed" EOL while the original files use just Unix type EOL. Solution: ------------ Roll back r284292. Previous Comments: ------------------------------------------------------------------------ [2011-12-12 13:58:40] clockwerx@php.net This... doesn't seem to be just those .ttf files. I grabbed http://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/1.10/ and there's no differences against http://github.com/pear/Image_Text/tests/ Trying to open these; I get: imagettfbbox(): Could not read font ------------------------------------------------------------------------ [2011-06-12 03:32:01] gozmeu at gmail dot com same here Warning: imagettftext() [function.imagettftext]: Could not find/open font in /home/gozmeu/domains/pwiguilds.com/public_html/travelcounter.php on line 40 ‰PNG  IHDRPÆ-q" PLTEÿÿÿÿÿÿsx¥cIDAT(‘cpÀ±,»ÊQ3GÍÄk&]7>7¡ˆFIEND®B`‚ with a valid or invalid ttf file :s ------------------------------------------------------------------------ [2010-12-07 12:51:33] hm2k@php.net This is not a difficult bug to fix. Anybody with commit access should be able to fix it. Can somebody fix it? Thanks. ------------------------------------------------------------------------ [2010-10-18 18:30:24] hm2k@php.net I would if I could. I don't think I have commit access to all of the ttf files on the php.net svn. ------------------------------------------------------------------------ [2010-07-27 01:54:48] rasmus@php.net You may just have to re-import them into Subversion or something. All I did was flip the svn property so Subversion wouldn't mangle them. ------------------------------------------------------------------------ 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 https://bugs.php.net/bug.php?id=52404 -- Edit this bug report at https://bugs.php.net/bug.php?id=52404&edit=1

« previous php.bugs (#165824) next »