Question

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"

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top