久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php webp轉(zhuǎn)jpg的方法介紹

      php webp轉(zhuǎn)jpg的方法:首先打開相應(yīng)的代碼文件;然后調(diào)用系統(tǒng)庫;最后通過“if($ext=='webp'){…}”方式將webp轉(zhuǎn)jpg即可。

      php webp轉(zhuǎn)jpg的方法介紹

      推薦:《PHP視頻教程》

      相關(guān)介紹:WebP(發(fā)音:weppy)是一種同時提供了有損壓縮與無損壓縮(可逆壓縮)的圖片文件格式,派生自影像編碼格式VP8,被認(rèn)為是WebM多媒體格式的姊妹項目,是由Google在購買On2 Technologies后發(fā)展出來,以BSD授權(quán)條款發(fā)布。

      JPEG(Joint Photographic Experts Group)是JPEG標(biāo)準(zhǔn)的產(chǎn)物,該標(biāo)準(zhǔn)由國際標(biāo)準(zhǔn)化組織(ISO)制訂,是面向連續(xù)色調(diào)靜止圖像的一種壓縮標(biāo)準(zhǔn)。 JPEG格式是最常用的圖像文件格式,后綴名為.jpg或.jpeg。

      php webp轉(zhuǎn)jpg

      最近做個項目,涉及到摳圖,

      但是webp格式的到火狐上顯示不了

      解決方案:

      //webp轉(zhuǎn)換成jpg格式 function webptojpgapi($inputurl,$inputname){     $apiurl = "https://api.cloudconvert.com/convert?apikey=[自己的apikey]&input=download&filename=$inputname&download=false&save=true&inputformat=webp&outputformat=jpg&file=$inputurl";     $res = file_get_contents($apiurl);     $res = json_decode($res,true);     return $res['output']['url'].'/'.str_replace('webp','jpg',$inputname); }

      官網(wǎng)上都有說明,具體就是這樣了,

      但是這樣有個不便之處,收費,尼瑪,坑爹的,所以采用了另外一種方式。

      調(diào)用系統(tǒng)庫,代碼如下,趕腳很高大上的樣子

      if($ext=='webp'){       $img_pathwebp = "Runtime/yy_".time().rand_string(3).'.png'; @file_put_contents($img_pathwebp, file_get_contents($img_path));       $img_pathwebp = realpath($img_pathwebp); $pic_path  = $img_pathwebp ;               @system("dwebp $img_pathwebp -o $pic_path", $retval);  }

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號