dongluanan7163 2016-05-07 11:15
浏览 48

php中的imagecreatefromjpeg禁止403

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.

  • 写回答

1条回答 默认 最新

  • duanpaotian2348 2016-05-07 11:23
    关注

    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 )

    评论

报告相同问题?

悬赏问题

  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路