本文整理汇总了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);
}