Can not use GD lib.

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Can not use GD lib.

Postby honux » 03. November 2006 02:49

Everytime i try to use GD lib, return an error...
i'm trying to use this :
Code: Select all
# Cabeçalho
header("Content-Type: image/png"); // Indica ao Navegador que o Contéudo é uma imagem!

# Váriavéis
$horas = date('h:i:s'); // Usamos a função date() para chamar as horas
$imagem = imageCreate(128, 32); // Cria uma Imagem 128x32

 # Paleta de Cores
 $preto = imagecolorallocate($imagem, 0, 0 ,0); // Adciona a Imagem a Cor Preta

 # Desenhando o Relógio
 imageRectangle($imagem, 0, 0, 127, 31, $preto); // Desenha um Retângulo com Borda Preta

 # Preenchendo com Gradiente (3d) Laranja
 for ($i=0; $i <= 30; $i++) { // Inicia um Loop
  $cor_i = imagecolorallocate($imagem, (254-($i*2)), (155-($i*2)), 0); // Faz com que a cor laranja diminua gradualmente até a cor preta
  imagefilledrectangle($imagem, 1, ($i+1), 126, ($i+1), $cor_i); // Desenha linha por linha com a cor graduada do laranja
 }

 # Escrevendo as Horas no Relógio
 imagestring($imagem, 80, 30, 8, $horas, $preto); // Escreve as horas na imagem, com a fonte tahoma, na cor preta

  # Exibindo o Relógio
  imagePNG($imagem); // Exibe o Relógio como uma Imagem PNG,


 # Finalizando
 imagedestroy($imagem); // Destrói a Imagem e libera o buffer!

but returns :
A imagem “http://127.0.0.1:8090/site/account.php?action=new_account” contém erros e não pode ser exibida.

That means...
The image "http://127.0.0.1:8090/site/account.php?action=new_account" contain errors and can not be showed
What can i do?
honux
 
Posts: 2
Joined: 03. November 2006 02:42

Postby Wiedmann » 03. November 2006 03:04

That means...

Your script have an error.

What can i do?

Comment the line with the header() function, execute the script and read the output (maybe an error message).
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby honux » 03. November 2006 03:50

No... my script do not have an error...
i got it from a website...

now i got this:
Image
honux
 
Posts: 2
Joined: 03. November 2006 02:42


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 74 guests