Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

imagettftext i imagecreatefromjpeg problem

[es] :: PHP :: imagettftext i imagecreatefromjpeg problem

[ Pregleda: 923 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

bane

Član broj: 449
Poruke: 230
*.teol.net.



Profil

icon imagettftext i imagecreatefromjpeg problem26.10.2018. u 11:53 - pre 66 meseci
<?php

$image = imagecreatefromjpeg("button.jpg");


$color = imagecolorallocate($image, 0, 0, 0);

imagettftext($image, 5, 0, 250, 250, $color, "C:/Windows/Fonts/Arial", "This is the text");

header("Content-Type: image/jpeg");
imagejpeg($image);

///////////////////////////////////////////////////////////

Jednostavno ne upload-uje sliku. Ovo je primer iz Programming PHP

Ako izuzmen

imagettftext($image, 5, 0, 250, 250, $color, "C:/Windows/Fonts/Arial", "This is the text");

slika se učitava, a kada uključim ovu funkciju nemogu da je uploadujem preko

<img src="button2.php?text=<?= urlencode("PHP Button"); ?>" />
1000 zasto 1000 zato
 
Odgovor na temu

Predrag Supurovic
Pedja YT9TP
Užice

Član broj: 157129
Poruke: 6275

Sajt: pedja.supurovic.net


+1570 Profil

icon Re: imagettftext i imagecreatefromjpeg problem26.10.2018. u 13:17 - pre 66 meseci
Možda ti putanja do dattoeke fotna nije ispravna?

STavi

header("Content-Type: image/jpeg");
imagejpeg($image);


Pod komentar pa će ti verovatno prikazati neku grešku.

 
Odgovor na temu

bane

Član broj: 449
Poruke: 230
*.teol.net.



Profil

icon Re: imagettftext i imagecreatefromjpeg problem26.10.2018. u 13:23 - pre 66 meseci
Hvala na javljanju, na kraju sam rešio problem:

//////////////////////////////////////////////////////

<?php

$image = imagecreatefrompng("button.png");
$text = isset($_GET['text']) ? $_GET['text'] : '';
$path = "C:/xampp/htdocs/Programming PHP/Graphics"; // button cache directory

$color = imagecolorallocate($image, 0, 0, 0);

imagettftext($image, 20, 0, 150, 100, $color, "C:/Windows/Fonts/Arial.ttf", $text);

header("Content-Type: image/png");
imagepng($image);
1000 zasto 1000 zato
 
Odgovor na temu

[es] :: PHP :: imagettftext i imagecreatefromjpeg problem

[ Pregleda: 923 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.