Hello guys
This is driving me mad. I would really appreciate if you told me any idea about why I see this square in red color just in my local xampp installation. If I run the code in the remote server (http://www.arreglaordenador.com/numberimage2.php) I see the square in black color instead of red. Do you have any ideas?
You might be viewing a cached image. Delete your browser cache and then revisit the page.
Thanks but I do not think that is the problem. I cleared the cache though, now that you told me. And as I thought I keep seeing the square in black instead of red. I guess you can see it if you click the link as well, can't you?
Yes, I see it in black and that makes sense. I dont understand why you see it in red from the localhost.
Hello
Well, I see it in red because I wrote the red color combination, that is to say, (255,0,0) as you can see in the code.
Could you please tell me any suggestion to change the color into white or red or even better, a transparent background?
Thanks
Thanks for the try. I just tried your code and it keeps showing black.
I have to say, though, that altough I tried like you gave it to me, I would have included some initialization for $red which you did not include.
Any other idea?
Thanks
Sorry, I just saw the same thing you saw on my system and it acted differently on localhost vs remote... after refreshing a few times it is displaying red on both now ...I'm trying a few things to reproduce again, ignore the code I gave you I got copy/paste happy.
The thing is that I just tried this code you told me, well, including three more lines:
Code:
<?php
$img = imagecreatetruecolor(100, 100);
// 127 is fully tranparent, 0 would be solid red, 63 would be 50% transparent :)
$background = imagecolorallocatealpha($img, 255, 0, 0, 110);
imagealphablending($img, false);
imagesavealpha($img, true);
imagefill($img, 1, 1, $background);
header('Content-type: image/png');
imagepng($img);
imagedestroy($img);
?>
It worked in my local server but not in the remote server(http://www.arreglaordenador.com/numberimage5.php) where you can see that the square is drawed in black instead of red, and that no transparency at all is applied. Do you have any ideas about why this does not work in remote?
Well the settings from the remote server are these:
As for the remote server configuration it is like this:
Configure Command :
'./configure' '--prefix=/usr/local/php5' '--with-mysql=/usr' '--with-gd' '--with-gzip' '--with-zlib' '--with-kerberos' '--enable-ftp' '--enable-gd-native-ttf' '--with-freetype-dir=/usr' '--with-jpeg-dir=/usr' '--with-xpm-dir=/usr' '--with-png-dir=/usr' '--with-imagick' '--enable-bcmath' '--with-xml' '--with-dom' '--with-gettext' '--enable-mbstring' '--with-curl' '--with-imap' '--enable-calendar' '--enable-mhash' '--enable-openssl' '--with-openssl=/usr' '--enable-exif' '--with-mhash=/usr' '--enable-mcrypt' '--with-mcrypt=/usr' '--with-imap-ssl' '--enable-xslt' '--with-dom-xslt=/usr' '--with-xslt-sablot=/usr' '--with-config-file-path=/home/sys/php5' '--with-pgsql=/usr' '--with-pdo-mysql' '--with-pdo-pgqsl' '--with-mysqli' '--with-pear' '--with-iconv' '--with-xsl=/usr' '--enable-fastcgi'
Code:
GD settings:
GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.7
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XPM Support enabled
XBM Support enabled
Do you think there is anything wrong with these settings I just wrote? Thanks.
Last edited by thosecars82; 12-14-2009 at 03:52 PM.
Bookmarks