本文整理匯總了PHP中myEntryUtils::getLocalImageFilePathByEntry方法的典型用法代碼示例。如果您正苦於以下問題:PHP myEntryUtils::getLocalImageFilePathByEntry方法的具體用法?PHP myEntryUtils::getLocalImageFilePathByEntry怎麽用?PHP myEntryUtils::getLocalImageFilePathByEntry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類myEntryUtils
的用法示例。
在下文中一共展示了myEntryUtils::getLocalImageFilePathByEntry方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: execute
//.........這裏部分代碼省略.........
$remoteUrl = kDataCenterMgr::getRemoteDcExternalUrlByDcId(1 - kDataCenterMgr::getCurrentDcId()) . $_SERVER['REQUEST_URI'];
kFileUtils::dumpUrl($remoteUrl);
}
}
}
if ($entry_id) {
$entry = entryPeer::retrieveByPKNoFilter($entry_id);
if (!$entry) {
// problem could be due to replication lag
kFileUtils::dumpApiRequest(kDataCenterMgr::getRemoteDcExternalUrlByDcId(1 - kDataCenterMgr::getCurrentDcId()));
}
} else {
// get the widget
$widget = widgetPeer::retrieveByPK($widget_id);
if (!$widget) {
KExternalErrors::dieError(KExternalErrors::ENTRY_AND_WIDGET_NOT_FOUND);
}
// get the kshow
$kshow_id = $widget->getKshowId();
$kshow = kshowPeer::retrieveByPK($kshow_id);
if ($kshow) {
$entry_id = $kshow->getShowEntryId();
} else {
$entry_id = $widget->getEntryId();
}
$entry = entryPeer::retrieveByPKNoFilter($entry_id);
if (!$entry) {
KExternalErrors::dieError(KExternalErrors::ENTRY_NOT_FOUND);
}
}
KalturaMonitorClient::initApiMonitor(false, 'extwidget.thumbnail', $entry->getPartnerId());
if ($nearest_aspect_ratio) {
// Get the entry's default thumbnail path (if any)
$defaultThumbnailPath = myEntryUtils::getLocalImageFilePathByEntry($entry, $version);
// Get the file path of the thumbnail with the nearest
$selectedThumbnailDescriptor = kThumbnailUtils::getNearestAspectRatioThumbnailDescriptorByEntryId($entry_id, $width, $height, $defaultThumbnailPath);
if ($selectedThumbnailDescriptor) {
$imageFilePath = $selectedThumbnailDescriptor->getImageFilePath();
$thumbWidth = $selectedThumbnailDescriptor->getWidth();
$thumbHeight = $selectedThumbnailDescriptor->getHeight();
// The required width and height will serve as the final crop values
$src_w = $width;
$src_h = $height;
// Base on the thumbnail's dimensions
kThumbnailUtils::scaleDimensions($thumbWidth, $thumbHeight, $width, $height, kThumbnailUtils::SCALE_UNIFORM_SMALLER_DIM, $width, $height);
// Set crop type
$type = KImageMagickCropper::CROP_AFTER_RESIZE;
}
}
$partner = $entry->getPartner();
// not allow capturing frames if the partner has FEATURE_DISALLOW_FRAME_CAPTURE permission
if ($vid_sec != -1 || $vid_slice != -1 || $vid_slices != -1) {
if ($partner->getEnabledService(PermissionName::FEATURE_BLOCK_THUMBNAIL_CAPTURE)) {
KExternalErrors::dieError(KExternalErrors::NOT_ALLOWED_PARAMETER);
}
}
if ($partner) {
if ($quality == 0) {
$quality = $partner->getDefThumbQuality();
}
if ($density == 0) {
$density = $partner->getDefThumbDensity();
}
}
$thumbParams = new kThumbnailParameters();
$thumbParams->setSupportAnimatedThumbnail($partner->getSupportAnimatedThumbnails());