Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用Zend GData Picasa API更新Picasa视频缩略图_Php_Api_Picasa_Zend Gdata - Fatal编程技术网

Php 使用Zend GData Picasa API更新Picasa视频缩略图

Php 使用Zend GData Picasa API更新Picasa视频缩略图,php,api,picasa,zend-gdata,Php,Api,Picasa,Zend Gdata,我想使用API更新picasa网络相册中的视频缩略图。 我已经运行了照片数据API 文件上说,我可以通过更新照片来“删除” 我尝试了以下函数,但什么也没发生。请帮忙 /** * Updates photo (for changing video thumbs * * @param Zend_Http_Client $client The authenticated client * @param string $user The user's accoun

我想使用API更新picasa网络相册中的视频缩略图。 我已经运行了照片数据API

文件上说,我可以通过更新照片来“删除”

我尝试了以下函数,但什么也没发生。请帮忙

/**
 * Updates photo (for changing video thumbs
 *
 * @param  Zend_Http_Client $client  The authenticated client
 * @param  string           $user    The user's account name
 * @param  integer          $albumId The album's id
 * @param  integer          $photoId The photo's id
 * @param  array            $photo   The uploaded photo
 * @return void
 */
function updatePhoto($client, $user, $albumId, $photoId, $photo)
{
        $photos = new Zend_Gdata_Photos($client);

        $photoQuery = new Zend_Gdata_Photos_PhotoQuery;
        $photoQuery->setUser($user);
        $photoQuery->setAlbumId($albumId);
        $photoQuery->setPhotoId($photoId);
        $photoQuery->setType('entry');

        $entry = $photos->getPhotoEntry($photoQuery);

        $fd = $photos->newMediaFileSource($photo["tmp_name"]);
        $fd->setContentType($photo["type"]);
        $entry->setMediaSource($fd);

        $entry->save();

        outputPhotoFeed($client, $user, $albumId, $photoId);        
}

我几乎是对的,更新了有效的代码

    /**
     * Updates photo (for changing video thumbs
     *
     * @param  Zend_Http_Client $client  The authenticated client
     * @param  string           $user    The user's account name
     * @param  integer          $albumId The album's id
     * @param  integer          $photoId The photo's id
     * @param  array            $photo   The uploaded photo
     * @return void
     */
    function updatePhoto($client, $user, $albumId, $photoId, $photo)
    {
            $photos = new Zend_Gdata_Photos($client);

            $photoQuery = new Zend_Gdata_Photos_PhotoQuery;
            $photoQuery->setUser($user);
            $photoQuery->setAlbumId($albumId);
            $photoQuery->setPhotoId($photoId);
            $photoQuery->setType('entry');

            $entry = $photos->getPhotoEntry($photoQuery);
            $uri = $entry->getLink("edit-media")->href;             

            $fd = $photos->newMediaFileSource($photo["tmp_name"]);
            $fd->setContentType($photo["type"]);
            $entry->setMediaSource($fd);

        $result = $entry->save($uri);
            if ($result) {
                outputPhotoFeed($client, $user, $albumId, $photoId);        
            } else {
                echo "There was an issue with upating this photo.";
            }
    }
有关完整代码和工作示例,请参见“”