本文整理匯總了PHP中BitmapHandler::getLongDesc方法的典型用法代碼示例。如果您正苦於以下問題:PHP BitmapHandler::getLongDesc方法的具體用法?PHP BitmapHandler::getLongDesc怎麽用?PHP BitmapHandler::getLongDesc使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BitmapHandler
的用法示例。
在下文中一共展示了BitmapHandler::getLongDesc方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getLongDesc
function getLongDesc($image)
{
global $wgLang;
$original = parent::getLongDesc($image);
wfSuppressWarnings();
$metadata = unserialize($image->getMetadata());
wfRestoreWarnings();
if (!$metadata || $metadata['frameCount'] <= 0) {
return $original;
}
$info = array();
$info[] = $original;
if ($metadata['loopCount'] == 0) {
$info[] = wfMsgExt('file-info-png-looped', 'parseinline');
} elseif ($metadata['loopCount'] > 1) {
$info[] = wfMsgExt('file-info-png-repeat', 'parseinline', $metadata['loopCount']);
}
if ($metadata['frameCount'] > 0) {
$info[] = wfMsgExt('file-info-png-frames', 'parseinline', $metadata['frameCount']);
}
if ($metadata['duration']) {
$info[] = $wgLang->formatTimePeriod($metadata['duration']);
}
return $wgLang->commaList($info);
}
示例2: getLongDesc
function getLongDesc($image)
{
global $wgUser, $wgLang;
$sk = $wgUser->getSkin();
$metadata = @unserialize($image->getMetadata());
if (!$metadata) {
return parent::getLongDesc($image);
}
$info = array();
$info[] = $image->getMimeType();
$info[] = $sk->formatSize($image->getSize());
if ($metadata['looped']) {
$info[] = wfMsgExt('file-info-gif-looped', 'parseinline');
}
if ($metadata['frameCount'] > 1) {
$info[] = wfMsgExt('file-info-gif-frames', 'parseinline', $metadata['frameCount']);
}
if ($metadata['duration']) {
$info[] = $wgLang->formatTimePeriod($metadata['duration']);
}
$infoString = $wgLang->commaList($info);
return "({$infoString})";
}
示例3: getLongDesc
/**
* @param $image File
* @return string
*/
function getLongDesc($image)
{
global $wgLang;
$original = parent::getLongDesc($image);
wfSuppressWarnings();
$metadata = unserialize($image->getMetadata());
wfRestoreWarnings();
if (!$metadata || $metadata['frameCount'] <= 1) {
return $original;
}
/* Preserve original image info string, but strip the last char ')' so we can add even more */
$info = array();
$info[] = $original;
if ($metadata['looped']) {
$info[] = wfMsgExt('file-info-gif-looped', 'parseinline');
}
if ($metadata['frameCount'] > 1) {
$info[] = wfMsgExt('file-info-gif-frames', 'parseinline', $metadata['frameCount']);
}
if ($metadata['duration']) {
$info[] = $wgLang->formatTimePeriod($metadata['duration']);
}
return $wgLang->commaList($info);
}
示例4: getLongDesc
/**
* @param File $image
* @return string
*/
function getLongDesc($image)
{
global $wgLang;
$original = parent::getLongDesc($image);
MediaWiki\suppressWarnings();
$metadata = unserialize($image->getMetadata());
MediaWiki\restoreWarnings();
if (!$metadata || $metadata['frameCount'] <= 0) {
return $original;
}
$info = [];
$info[] = $original;
if ($metadata['loopCount'] == 0) {
$info[] = wfMessage('file-info-png-looped')->parse();
} elseif ($metadata['loopCount'] > 1) {
$info[] = wfMessage('file-info-png-repeat')->numParams($metadata['loopCount'])->parse();
}
if ($metadata['frameCount'] > 0) {
$info[] = wfMessage('file-info-png-frames')->numParams($metadata['frameCount'])->parse();
}
if ($metadata['duration']) {
$info[] = $wgLang->formatTimePeriod($metadata['duration']);
}
return $wgLang->commaList($info);
}
示例5: getLongDesc
/**
* @param File $image
* @return string
*/
function getLongDesc($image)
{
global $wgLang;
$original = parent::getLongDesc($image);
MediaWiki\suppressWarnings();
$metadata = unserialize($image->getMetadata());
MediaWiki\restoreWarnings();
if (!$metadata || $metadata['frameCount'] <= 1) {
return $original;
}
/* Preserve original image info string, but strip the last char ')' so we can add even more */
$info = [];
$info[] = $original;
if ($metadata['looped']) {
$info[] = wfMessage('file-info-gif-looped')->parse();
}
if ($metadata['frameCount'] > 1) {
$info[] = wfMessage('file-info-gif-frames')->numParams($metadata['frameCount'])->parse();
}
if ($metadata['duration']) {
$info[] = $wgLang->formatTimePeriod($metadata['duration']);
}
return $wgLang->commaList($info);
}