当前位置: 首页>>代码示例>>PHP>>正文


PHP asset::getWidth方法代码示例

本文整理汇总了PHP中asset::getWidth方法的典型用法代码示例。如果您正苦于以下问题:PHP asset::getWidth方法的具体用法?PHP asset::getWidth怎么用?PHP asset::getWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在asset的用法示例。


在下文中一共展示了asset::getWidth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: linkFromAsset

 public function linkFromAsset(asset $fromAsset)
 {
     $this->setWidth($fromAsset->getWidth());
     $this->setHeight($fromAsset->getHeight());
     $this->setContainerFormat($fromAsset->getContainerFormat());
     $this->setSize($fromAsset->getSize());
     $this->setFileExt($fromAsset->getFileExt());
     $this->setTags($fromAsset->getTags());
     $this->setDescription($fromAsset->getDescription());
     $this->incrementVersion();
     $this->setStatusLocalReady();
 }
开发者ID:DBezemer,项目名称:server,代码行数:12,代码来源:asset.php

示例2: generateThumbnail

 private static function generateThumbnail(asset $srcAsset, thumbParamsOutput $destThumbParamsOutput, &$errDescription, $rotate = null)
 {
     $srcSyncKey = $srcAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
     list($fileSync, $local) = kFileSyncUtils::getReadyFileSyncForKey($srcSyncKey, true, false);
     if (!$fileSync || $fileSync->getFileType() == FileSync::FILE_SYNC_FILE_TYPE_URL) {
         $errDescription = 'Source asset could has no valid file sync';
         return false;
     }
     $srcPath = $fileSync->getFullPath();
     $srcWamsAssetId = $fileSync->getWamsAssetId();
     $uniqid = uniqid('thumb_');
     $destPath = kConf::get('temp_folder') . "/thumb/{$uniqid}.jpg";
     $logPath = $destPath . '.log';
     if (is_null($srcWamsAssetId)) {
         if (!file_exists($srcPath)) {
             $errDescription = "Source file [{$srcPath}] does not exist";
             return false;
         }
         if (!is_file($srcPath)) {
             $errDescription = "Source file [{$srcPath}] is not a file";
             return false;
         }
     }
     try {
         if ($srcAsset->getType() == assetType::FLAVOR) {
             /* @var $srcAsset flavorAsset */
             $dar = null;
             $mediaInfo = mediaInfoPeer::retrieveByFlavorAssetId($srcAsset->getId());
             if ($mediaInfo) {
                 $dar = $mediaInfo->getVideoDar();
             }
             // generates the thumbnail
             if (!is_null($srcWamsAssetId)) {
                 $thumbMaker = new KWAMSThumbnailMaker($srcWamsAssetId, $destPath);
                 $created = $thumbMaker->createThumbnail($destThumbParamsOutput->getVideoOffset(), $srcAsset->getWidth(), $srcAsset->getHeight(), $dar);
             } else {
                 $thumbMaker = new KFFMpegThumbnailMaker($srcPath, $destPath, kConf::get('bin_path_ffmpeg'));
                 $created = $thumbMaker->createThumnail($destThumbParamsOutput->getVideoOffset(), $srcAsset->getWidth(), $srcAsset->getHeight(), null, null, $dar);
             }
             if (!$created || !file_exists($destPath)) {
                 $errDescription = "Thumbnail not captured";
                 return false;
             }
             $srcPath = $destPath;
             $uniqid = uniqid('thumb_');
             $destPath = kConf::get('temp_folder') . "/thumb/{$uniqid}.jpg";
         }
         $quality = $destThumbParamsOutput->getQuality();
         $cropType = $destThumbParamsOutput->getCropType();
         $cropX = $destThumbParamsOutput->getCropX();
         $cropY = $destThumbParamsOutput->getCropY();
         $cropWidth = $destThumbParamsOutput->getCropWidth();
         $cropHeight = $destThumbParamsOutput->getCropHeight();
         $bgcolor = $destThumbParamsOutput->getBackgroundColor();
         $width = $destThumbParamsOutput->getWidth();
         $height = $destThumbParamsOutput->getHeight();
         $scaleWidth = $destThumbParamsOutput->getScaleWidth();
         $scaleHeight = $destThumbParamsOutput->getScaleHeight();
         $density = $destThumbParamsOutput->getDensity();
         $stripProfiles = $destThumbParamsOutput->getStripProfiles();
         $cropper = new KImageMagickCropper($srcPath, $destPath, kConf::get('bin_path_imagemagick'), true);
         $cropped = $cropper->crop($quality, $cropType, $width, $height, $cropX, $cropY, $cropWidth, $cropHeight, $scaleWidth, $scaleHeight, $bgcolor, $density, $rotate, $stripProfiles);
         if (!$cropped || !file_exists($destPath)) {
             $errDescription = "Crop failed";
             return false;
         }
         return $destPath;
     } catch (Exception $ex) {
         $errDescription = $ex->getMessage();
         return false;
     }
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:72,代码来源:kBusinessPreConvertDL.php

示例3: setFlavorAsset

 public function setFlavorAsset(DOMElement $item, asset $flavorAsset, $flavorAssetRemoteUrl, $lang)
 {
     $this->setNodeValue('media:content/@url', $flavorAssetRemoteUrl, $item);
     $this->setNodeValue('media:content/@width', $flavorAsset->getWidth(), $item);
     $this->setNodeValue('media:content/@height', $flavorAsset->getHeight(), $item);
     $this->setNodeValue('media:content/@type', $this->getContentType($flavorAssetRemoteUrl), $item);
     if ($lang) {
         $this->setNodeValue('media:content/@lang', $lang, $item);
     }
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:10,代码来源:UverseFeed.php


注:本文中的asset::getWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。