Upgrade to 3.2.5

This commit is contained in:
Bastian Allgeier
2019-09-24 11:00:59 +02:00
parent ff9b5b1861
commit 447a9dd266
234 changed files with 1990 additions and 1224 deletions

View File

@@ -13,7 +13,6 @@ namespace Kirby\Image;
*/
class Camera
{
/**
* Make exif data
*
@@ -87,7 +86,7 @@ class Camera
*
* @return array
*/
public function __debuginfo(): array
public function __debugInfo(): array
{
return $this->toArray();
}

View File

@@ -4,7 +4,6 @@ namespace Kirby\Image\Darkroom;
ini_set('memory_limit', '512M');
use Exception;
use claviska\SimpleImage;
use Kirby\Image\Darkroom;

View File

@@ -16,7 +16,6 @@ namespace Kirby\Image;
*/
class Dimensions
{
/**
* the height of the parent object
*
@@ -48,7 +47,7 @@ class Dimensions
*
* @return array
*/
public function __debuginfo(): array
public function __debugInfo(): array
{
return $this->toArray();
}
@@ -178,7 +177,7 @@ class Dimensions
* @param bool $force If true, the dimensions will be
* upscaled to fit the box if smaller
* @return self object with recalculated dimensions
*/
*/
protected function fitSize(string $ref, int $fit = null, bool $force = false)
{
if ($fit === 0 || $fit === null) {
@@ -217,7 +216,7 @@ class Dimensions
* @param bool $force If true, the dimensions will be
* upscaled to fit the box if smaller
* @return self object with recalculated dimensions
*/
*/
public function fitWidth(int $fit = null, bool $force = false)
{
return $this->fitSize('width', $fit, $force);
@@ -286,12 +285,12 @@ class Dimensions
if ($xml !== false) {
$attr = $xml->attributes();
$width = floatval($attr->width);
$height = floatval($attr->height);
$width = (float)($attr->width);
$height = (float)($attr->height);
if (($width === 0.0 || $height === 0.0) && empty($attr->viewBox) === false) {
$box = explode(' ', $attr->viewBox);
$width = floatval($box[2] ?? 0);
$height = floatval($box[3] ?? 0);
$width = (float)($box[2] ?? 0);
$height = (float)($box[3] ?? 0);
}
}
@@ -356,7 +355,7 @@ class Dimensions
public function ratio(): float
{
if ($this->width !== 0 && $this->height !== 0) {
return ($this->width / $this->height);
return $this->width / $this->height;
}
return 0;
@@ -386,7 +385,7 @@ class Dimensions
/**
* Resize and crop
*
* @params array $options
* @param array $options
* @return self
*/
public function thumb(array $options = [])

View File

@@ -15,7 +15,6 @@ use Kirby\Toolkit\V;
*/
class Exif
{
/**
* the parent image object
* @var Image
@@ -84,7 +83,7 @@ class Exif
/**
* Constructor
*
* @param Kirby\Image\Image $image
* @param \Kirby\Image\Image $image
*/
public function __construct(Image $image)
{
@@ -106,7 +105,7 @@ class Exif
/**
* Returns the Camera object
*
* @return Kirby\Image\Camera|null
* @return \Kirby\Image\Camera|null
*/
public function camera()
{
@@ -120,7 +119,7 @@ class Exif
/**
* Returns the location object
*
* @return Kirby\Image\Location|null
* @return \Kirby\Image\Location|null
*/
public function location()
{
@@ -287,7 +286,7 @@ class Exif
*
* @return array
*/
public function __debuginfo(): array
public function __debugInfo(): array
{
return array_merge($this->toArray(), [
'camera' => $this->camera(),

View File

@@ -7,7 +7,6 @@ use Kirby\Http\Response;
use Kirby\Toolkit\File;
use Kirby\Toolkit\Html;
use Kirby\Toolkit\Mime;
use Kirby\Toolkit\Str;
use Kirby\Toolkit\V;
/**
@@ -21,10 +20,9 @@ use Kirby\Toolkit\V;
* @link https://getkirby.com
* @copyright Bastian Allgeier GmbH
* @license https://opensource.org/licenses/MIT
*/
*/
class Image extends File
{
/**
* optional url where the file is reachable
* @var string
@@ -58,7 +56,7 @@ class Image extends File
*
* @return array
*/
public function __debuginfo(): array
public function __debugInfo(): array
{
return array_merge($this->toArray(), [
'dimensions' => $this->dimensions(),
@@ -80,7 +78,7 @@ class Image extends File
/**
* Returns the dimensions of the file if possible
*
* @return Kirby\Image\Dimensions
* @return \Kirby\Image\Dimensions
*/
public function dimensions()
{
@@ -114,7 +112,7 @@ class Image extends File
/**
* Returns the exif object for this file (if image)
*
* @return Kirby\Image\Exif
* @return \Kirby\Image\Exif
*/
public function exif()
{
@@ -129,7 +127,7 @@ class Image extends File
* Sends an appropriate header for the asset
*
* @param boolean $send
* @return Kirby\Http\Response|string
* @return \Kirby\Http\Response|string
*/
public function header(bool $send = true)
{
@@ -200,6 +198,7 @@ class Image extends File
/**
* Runs a set of validations on the image object
*
* @param array $rules
* @return bool
*/
public function match(array $rules): bool

View File

@@ -14,7 +14,6 @@ namespace Kirby\Image;
*/
class Location
{
/**
* latitude
*
@@ -99,7 +98,7 @@ class Location
return $parts[0];
}
return floatval($parts[0]) / floatval($parts[1]);
return (float)($parts[0]) / (float)($parts[1]);
}
/**
@@ -130,7 +129,7 @@ class Location
*
* @return array
*/
public function __debuginfo(): array
public function __debugInfo(): array
{
return $this->toArray();
}