Php 使用Zend GData Picasa API更新Picasa视频缩略图
我想使用API更新picasa网络相册中的视频缩略图。 我已经运行了照片数据API 文件上说,我可以通过更新照片来“删除” 我尝试了以下函数,但什么也没发生。请帮忙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
/**
* 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.";
}
}
有关完整代码和工作示例,请参见“”