public function testImageInfo() { $imageView = new Qiniu_ImageInfo(); $url = $this->url; $expectedUrl = $url . '?imageInfo'; $this->assertEquals($imageView->MakeRequest($url), $expectedUrl); }
public function imageInfo($filename) { $this->setBucketAndKey($filename); Qiniu_SetKeys($this->accessKey, $this->secretKey); $domain = $this->getDomain(); $baseUrl = Qiniu_RS_MakeBaseUrl($domain, $this->key); $imgInfo = new \Qiniu_ImageInfo(); $imgInfoUrl = $imgInfo->MakeRequest($baseUrl); $info = json_decode(@file_get_contents($imgInfoUrl), true); return $info; }
if ($err === Qiniu_RSF_EOF) { var_dump($iterms); } else { var_dump(err); } } else { var_dump($iterms); } //------------------------------------fop----------------------------------------- # @gist base_url //$baseUrl 就是您要访问资源的地址 $baseUrl = Qiniu_RS_MakeBaseUrl($domain, $key1); # @endgist # @gist image_info $getPolicy = new Qiniu_RS_GetPolicy(); $imgInfo = new Qiniu_ImageInfo(); //生成fopUrl $imgInfoUrl = $imgInfo->MakeRequest($baseUrl); //对fopUrl 进行签名,生成privateUrl。 公有bucket 此步可以省去。 $imgInfoPrivateUrl = $getPolicy->MakeRequest($imgInfoUrl, null); echo "\n\n====> imageInfo privateUrl: \n"; echo $imgInfoPrivateUrl . "\n"; # @endgist # @gist image_exif $getPolicy = new Qiniu_RS_GetPolicy(); $imgExif = new Qiniu_Exif(); //生成fopUrl $imgExifUrl = $imgExif->MakeRequest($baseUrl); //对fopUrl 进行签名,生成privateUrl。 公有bucket 此步可以省去。 $imgExifPrivateUrl = $getPolicy->MakeRequest($imgExifUrl, null); echo "\n\n====> imageView privateUrl: \n";