本文整理汇总了PHP中Picture::getSize方法的典型用法代码示例。如果您正苦于以下问题:PHP Picture::getSize方法的具体用法?PHP Picture::getSize怎么用?PHP Picture::getSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Picture
的用法示例。
在下文中一共展示了Picture::getSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareMessage
function prepareMessage(&$message, $jid = null)
{
if ($jid != $message->jidto && $jid != $message->jidfrom && $jid != null) {
return $this->_wrapper;
}
$message->jidto = echapJS($message->jidto);
$message->jidfrom = echapJS($message->jidfrom);
if (isset($message->html)) {
$message->body = $message->html;
} else {
// We add some smileys...
$message->convertEmojis();
$message->addUrls();
// $message->body = prepareString(htmlentities($message->body , ENT_COMPAT,'UTF-8'));
}
if (isset($message->sticker)) {
$p = new Picture();
$sticker = $p->get($message->sticker, false, false, 'png');
$stickerSize = $p->getSize();
if ($sticker == false) {
$r = new Request();
$r->setTo($message->jidfrom)->setResource($message->resource)->setCid($message->sticker)->request();
} else {
$message->sticker = ['url' => $sticker, 'width' => $stickerSize['width'], 'height' => $stickerSize['height']];
}
}
if (isset($message->picture)) {
$message->sticker = ['url' => $message->picture, 'picture' => true];
}
$message->publishedPrepared = prepareDate(strtotime($message->published), true);
if ($message->delivered) {
$message->delivered = prepareDate(strtotime($message->delivered), true);
}
$date = substr($message->published, 0, 10);
if ($message->type == 'groupchat') {
$message->color = stringToColor($message->session . $message->resource . $message->jidfrom . $message->type);
//fillup $wrapper
if ($message->body != "") {
if (!array_key_exists($date, $this->_wrapper)) {
$this->_wrapper[$date] = [$message];
} else {
array_push($this->_wrapper[$date], $message);
}
}
} else {
$msgkey = $message->jidfrom . '>' . substr($message->published, 11, 5);
//fillup $wrapper
if (!array_key_exists($date, $this->_wrapper)) {
$sticker = "";
if (isset($message->sticker)) {
$sticker = "sticker";
}
$this->_wrapper[$date] = ['0' . $sticker . '<' . $msgkey => [$message]];
} else {
//date contains at least one speaker@time=>msg already
end($this->_wrapper[$date]);
$lastkey = key($this->_wrapper[$date]);
if (substr($lastkey, strpos($lastkey, '<') + 1) == $msgkey && !isset($message->sticker) && strpos($lastkey, "sticker<") === false) {
// the previous msg was not a sticker
array_push($this->_wrapper[$date][$lastkey], $message);
} else {
$sticker = "";
if (isset($message->sticker)) {
$sticker = "sticker";
}
$this->_wrapper[$date][count($this->_wrapper[$date]) . $sticker . '<' . $msgkey] = [$message];
}
}
}
return $this->_wrapper;
}