Skip to content

Commit

Permalink
imageInfo code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
robsonvleite committed Jun 29, 2020
1 parent 2bf6266 commit cf9e1d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Cropper.php
Expand Up @@ -81,14 +81,14 @@ public function make(string $imagePath, int $width, int $height = null): ?string
$this->imagePath = $imagePath;
$this->imageName = $this->name($this->imagePath, $width, $height);
$this->imageMime = mime_content_type($this->imagePath);
$this->imageInfo = pathinfo($this->imagePath);

if (!in_array($this->imageMime, self::$allowedExt)) {
return "Not a valid JPG or PNG image";
}

$imageInfo = pathinfo($this->imagePath);
$imageWebP = "{$this->cachePath}/{$this->imageName}.webp";
$imageExt = "{$this->cachePath}/{$this->imageName}.{$this->imageInfo['extension']}";
$imageExt = "{$this->cachePath}/{$this->imageName}.{$imageInfo['extension']}";

if ($this->webP && file_exists($imageWebP) && is_file($imageWebP)) {
return $imageWebP;
Expand Down

0 comments on commit cf9e1d2

Please sign in to comment.