Jump to content
robyyxx

PHP add text to image

Recommended Posts

Posted (edited)

Lucrez la un script care trebuie sa adauge un anumite text intr-o imagine jpg.

Eu m-am luat dupa asta si l-am modificat.

Momentan il rulez pe XAMPP si imi da eroare asa:

error.png

Am incercat si exemplul care este dat acolo si tot aceeasi eroare.

Am citit acolo ca trebuie ceva librarii.

Chiar nu stiu ce sa fac, ma ajuta cineva?

Edit:

Versiunea mea


<?php


header('Content-type: image/jpeg');
$jpg_image = imagecreatefromjpeg('sablon.jpg');
$black = imagecolorallocate($im, 0, 0, 0);
$font_path = 'font.ttf';
$text = "1";
imagettftext($jpg_image, 5, 0, 50, 50, $black, $font_path, $text);
imagejpeg($jpg_image);
imagedestroy($jpg_image);
?>

Romanian_Identity_Card_2009.jpg

Edited by robyyxx
Posted (edited)
Bre, asta face ACTE de identitate false si voi il sprijiniti in loc sa dati report la post ?

Nu stiu de ce am impresia ca de fapt face o aplicatie stupida pentru facebook...

TOT ce e in error_log e eroare cand vine vorba de debug.

Scrie alb pe negru:

[07-Feb-2014 17:28:09 Europe/Berlin] PHP Warning: imagecreatefromjpeg(/sablon.jpg): failed to open stream: No such file or directory in C:\xampp\htdocs\edit.php on line 8

Adica nu gaseste imaginea.

// acum vad ca e banat, in fine. Se descurca singur mai departe.

Edited by eusimplu

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...