I'm going to merge two images one is the user profile picture of facebook which I get using graph API
and other image is host in my server.
When I try to imagecreatefromjpeg
for profile pic it throw Forbidden Error 403
.
$url='https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xfp1/v/t1.0-1/c69.165.576.576/s50x50/12661918_1679202092322313_2752077154994097120_n.jpg?oh=f3c405146a3be5b613f046672538949c';
imagecreatefromjpeg($url);
If facebook does not permission to do so then why other site such like meaww.com
and many other sites are doing this.
How can I do this.
You can get your image from facebook as binary like base64 and also same acrion for your image on your host, then you can use imagecreatefromstring function and after that use the below function for merging two image. imagecopymerge ( resource $dst_im , resource $src_im , int $dst_x , int $dst_y , int $src_x , int $src_y , int $src_w , int $src_h , int $pct )