-1

I use the Following Php Code to Manipulate image using GD library and upload that modified image to facebook.My question is Can i achieve the Same using Javascript.If so What technology should i use.thanks.

$iOut = imagecreatefromjpeg("new.jpg");
$name = "hello all";
imagettftext( $iOut, 20, 0,214,119, $blue, $font, $name ); 
imagejpeg($iOut,"neww.jpg"); 
$filename="neww.jpg";
$attachment['image'] ='@'.realpath($filename);
$photo = $facebook->api('/'.$aid.'/photos', 'POST', $attachment);

note:The above code add the Text "hello all" to an new image "neww.jpg"

vishnu
  • 869
  • 1
  • 16
  • 25

1 Answers1

0

I have been into client-side javascript picture manipulation lately, but there are a few bottlenecks. The biggest problem in using this is that it is not very well supported around browsers. If you need it to work in Internet Explorer, then the PHP-way is your way.

If you are interested in how a resize is done, for example, please check my post here: http://boxed.hu/articles/html5-client-side-image-resize/ There also is working example of it which is linked into the post.

I hope this helps, let me know if you have any more questions.

Eduárd Moldován
  • 1,495
  • 3
  • 13
  • 29
  • hmm how can i get the url of image updated..so i can use it to upload in facebook – vishnu Jun 01 '12 at 15:25
  • If I get it right, then you need to send Facebook a url, which contains the image itself. If this is the case, then a client-side implementation is not goind to work, because that is stored only in your browser. What you might do is store that on the server, then get the url and send that to Facebook. But this looks a bit complicated to me, your way of implementing it might be simpler and better. – Eduárd Moldován Jun 01 '12 at 15:35