mirror of
https://github.com/friendica/friendica
synced 2025-09-12 21:51:34 +02:00
Fix code style
This commit is contained in:
parent
6633d1b491
commit
a06a816c08
2 changed files with 22 additions and 22 deletions
|
|
@ -157,10 +157,10 @@ class Pager
|
|||
'text' => $this->l10n->t('newer'),
|
||||
'class' => 'previous' . ($this->getPage() == 1 ? ' disabled' : '')
|
||||
],
|
||||
'next' => [
|
||||
'next' => [
|
||||
'url' => Strings::ensureQueryParameter($this->baseQueryString . '&page=' . ($this->getPage() + 1)),
|
||||
'text' => $this->l10n->t('older'),
|
||||
'class' => 'next' . ($displayedItemCount < $this->getItemsPerPage() ? ' disabled' : '')
|
||||
'class' => 'next' . ($displayedItemCount < $this->getItemsPerPage() ? ' disabled' : '')
|
||||
]
|
||||
];
|
||||
|
||||
|
|
@ -211,12 +211,12 @@ class Pager
|
|||
$numpages = (int) ceil($totalItemCount / $this->getItemsPerPage());
|
||||
|
||||
$numstart = 1;
|
||||
$numstop = $numpages;
|
||||
$numstop = $numpages;
|
||||
|
||||
// Limit the number of displayed page number buttons.
|
||||
if ($numpages > 8) {
|
||||
$numstart = ($this->getPage() > 4) ? ($this->getPage() - 4) : 1;
|
||||
$numstop = ($this->getPage() > ($numpages - 7)) ? $numpages : ($numstart + 8);
|
||||
$numstop = ($this->getPage() > ($numpages - 7)) ? $numpages : ($numstart + 8);
|
||||
}
|
||||
|
||||
$pages = [];
|
||||
|
|
@ -239,7 +239,7 @@ class Pager
|
|||
|
||||
$data['pages'] = $pages;
|
||||
|
||||
$lastpage = (($numpages > intval($numpages)) ? intval($numpages)+1 : $numpages);
|
||||
$lastpage = (($numpages > intval($numpages)) ? intval($numpages) + 1 : $numpages);
|
||||
|
||||
$data['next'] = [
|
||||
'url' => Strings::ensureQueryParameter($this->baseQueryString . '&page=' . ($this->getPage() + 1)),
|
||||
|
|
|
|||
|
|
@ -48,8 +48,8 @@ class Image
|
|||
public function __construct(string $data, string $type = '', string $filename = '', bool $imagick = true)
|
||||
{
|
||||
$this->filename = $filename;
|
||||
$type = Images::addMimeTypeByDataIfInvalid($type, $data);
|
||||
$type = Images::addMimeTypeByExtensionIfInvalid($type, $filename);
|
||||
$type = Images::addMimeTypeByDataIfInvalid($type, $data);
|
||||
$type = Images::addMimeTypeByExtensionIfInvalid($type, $filename);
|
||||
|
||||
if (Images::isSupportedMimeType($type)) {
|
||||
$this->originType = $this->outputType = Images::getImageTypeByMimeType($type);
|
||||
|
|
@ -108,7 +108,7 @@ class Image
|
|||
private function isAnimatedWebP(string $data)
|
||||
{
|
||||
$header_format = 'A4Riff/I1Filesize/A4Webp/A4Vp/A74Chunk';
|
||||
$header = @unpack($header_format, $data);
|
||||
$header = @unpack($header_format, $data);
|
||||
|
||||
if (!isset($header['Riff']) || strtoupper($header['Riff']) !== 'RIFF') {
|
||||
return false;
|
||||
|
|
@ -348,7 +348,7 @@ class Image
|
|||
return false;
|
||||
}
|
||||
|
||||
$width = $this->getWidth();
|
||||
$width = $this->getWidth();
|
||||
$height = $this->getHeight();
|
||||
|
||||
$scale = Images::getScalingDimensions($width, $height, $max);
|
||||
|
|
@ -412,8 +412,8 @@ class Image
|
|||
return;
|
||||
}
|
||||
|
||||
$w = imagesx($this->image);
|
||||
$h = imagesy($this->image);
|
||||
$w = imagesx($this->image);
|
||||
$h = imagesy($this->image);
|
||||
$flipped = imagecreate($w, $h);
|
||||
if ($horiz) {
|
||||
for ($x = 0; $x < $w; $x++) {
|
||||
|
|
@ -521,7 +521,7 @@ class Image
|
|||
return false;
|
||||
}
|
||||
|
||||
$width = $this->getWidth();
|
||||
$width = $this->getWidth();
|
||||
$height = $this->getHeight();
|
||||
|
||||
if ((!$width) || (!$height)) {
|
||||
|
|
@ -530,22 +530,22 @@ class Image
|
|||
|
||||
if ($width < $min && $height < $min) {
|
||||
if ($width > $height) {
|
||||
$dest_width = $min;
|
||||
$dest_width = $min;
|
||||
$dest_height = intval(($height * $min) / $width);
|
||||
} else {
|
||||
$dest_width = intval(($width * $min) / $height);
|
||||
$dest_width = intval(($width * $min) / $height);
|
||||
$dest_height = $min;
|
||||
}
|
||||
} else {
|
||||
if ($width < $min) {
|
||||
$dest_width = $min;
|
||||
$dest_width = $min;
|
||||
$dest_height = intval(($height * $min) / $width);
|
||||
} else {
|
||||
if ($height < $min) {
|
||||
$dest_width = intval(($width * $min) / $height);
|
||||
$dest_width = intval(($width * $min) / $height);
|
||||
$dest_height = $min;
|
||||
} else {
|
||||
$dest_width = $width;
|
||||
$dest_width = $width;
|
||||
$dest_height = $height;
|
||||
}
|
||||
}
|
||||
|
|
@ -620,7 +620,7 @@ class Image
|
|||
imagedestroy($this->image);
|
||||
}
|
||||
|
||||
$this->image = $dest;
|
||||
$this->image = $dest;
|
||||
$this->width = imagesx($this->image);
|
||||
$this->height = imagesy($this->image);
|
||||
}
|
||||
|
|
@ -797,9 +797,9 @@ class Image
|
|||
}
|
||||
$row[] = [$colors['r'], $colors['g'], $colors['b']];
|
||||
} else {
|
||||
$index = imagecolorat($image->image, $x, $y);
|
||||
$index = imagecolorat($image->image, $x, $y);
|
||||
$colors = @imagecolorsforindex($image->image, $index);
|
||||
$row[] = [$colors['red'], $colors['green'], $colors['blue']];
|
||||
$row[] = [$colors['red'], $colors['green'], $colors['blue']];
|
||||
}
|
||||
}
|
||||
$pixels[] = $row;
|
||||
|
|
@ -828,7 +828,7 @@ class Image
|
|||
|
||||
if ($this->isImagick()) {
|
||||
$this->image = new Imagick();
|
||||
$draw = new ImagickDraw();
|
||||
$draw = new ImagickDraw();
|
||||
$this->image->newImage($scaled['width'], $scaled['height'], '', 'png');
|
||||
} else {
|
||||
$this->image = imagecreatetruecolor($scaled['width'], $scaled['height']);
|
||||
|
|
@ -836,7 +836,7 @@ class Image
|
|||
|
||||
for ($y = 0; $y < $scaled['height']; ++$y) {
|
||||
for ($x = 0; $x < $scaled['width']; ++$x) {
|
||||
[$r, $g, $b] = $pixels[$y][$x];
|
||||
list($r, $g, $b) = $pixels[$y][$x];
|
||||
if ($draw !== null) {
|
||||
$draw->setFillColor("rgb($r, $g, $b)");
|
||||
$draw->point($x, $y);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue