Not really a bug but a case of changing php.
Share Image was working fine until i did an update to xampp version 1.6.2 with PHP 5.2.2
The url http://mysite/netjukebox/image.php was giving the following messages:
Warning: imagettftext() [function.imagettftext]: Invalid font filename in C:\Program Files\xampp\htdocs\netjukebox\image.php on line 183
Warning: imagettftext() [function.imagettftext]: Invalid font filename in C:\Program Files\xampp\htdocs\netjukebox\image.php on line 184
Warning: imagettftext() [function.imagettftext]: Invalid font filename in C:\Program Files\xampp\htdocs\netjukebox\image.php on line 185
and a lot of characters.
Changing the following lines in image.php
imagettftext($dst_image, 9, 0, 55, 13, $font_color, 'arial.ttf', $text);
imagettftext($dst_image, 9, 0, 55, 30, $font_color, 'arial.ttf', $bitmap['artist']);
imagettftext($dst_image, 9, 0, 55, 47, $font_color, 'arial.ttf', $bitmap['album']);
in
imagettftext($dst_image, 9, 0, 55, 13, $font_color, 'C:\WINDOWS\Fonts\arial.ttf', $text);
imagettftext($dst_image, 9, 0, 55, 30, $font_color, 'C:\WINDOWS\Fonts\arial.ttf', $bitmap['artist']);
imagettftext($dst_image, 9, 0, 55, 47, $font_color, 'C:\WINDOWS\Fonts\arial.ttf', $bitmap['album']);
did solve the problem for me.
"Newer PHP versions seems to have a problem with using the GDFONTPATH evironment variable" was what i found from googling.
Share Image and XAMPP 1.6.2
- wbartels
- netjukebox developer
- Posts: 881
- Joined: Thu Nov 04, 2004 3:12 pm
- Location: Netherlands
- Contact:
I think it is a good idea to add a ttf font to netjukebox:
This will fix your problem and I think it will also work on systems without ttf fonts.
I found a nice looking font witch is also open source: DejaVuSans.ttf
http://dejavu.sourceforge.net/wiki/index.php/Download
Code: Select all
// Text
$font = $cfg['home_dir'] . '/font/DejaVuSans.ttf';
$font_color = imagecolorallocate($dst_image, 0, 0, 99);
imagettftext($dst_image, 8, 0, 55, 13, $font_color, $font, $text);
imagettftext($dst_image, 8, 0, 55, 30, $font_color, $font, $bitmap['artist']);
imagettftext($dst_image, 8, 0, 55, 47, $font_color, $font, $bitmap['album']);
I found a nice looking font witch is also open source: DejaVuSans.ttf
http://dejavu.sourceforge.net/wiki/index.php/Download