php中imagecreatefromjpeg中禁止403


Forbidden 403 in imagecreatefromjpeg in php

我要合并两个图像,一个是我使用graph API获得的facebook的用户配置文件图片,另一个图像是我的服务器中的主机
当我尝试为配置文件图片imagecreatefromjpeg时,它会抛出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);

如果脸书不允许这样做,那么为什么其他网站,如meaww.com和许多其他网站会这样做
我该怎么做。

你可以从facebook上获得像base64一样的二进制图像,也可以在主机上获得相同的图像,然后你可以使用imagecreatefromstring函数,然后使用下面的函数合并两个图像。imagecopymerge(资源$dst_im,资源$src_im,int$dst_x,int$dst_y,int$src_x,int$src_y,int$src_w,int$src.h,int$pct)