Skip to content

Commit

Permalink
Fix constant reference for Image::type
Browse files Browse the repository at this point in the history
  • Loading branch information
itismadness committed Aug 15, 2021
1 parent 71d6384 commit ee837b5
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions app/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ function width(): int {

function display() {
switch($this->type) {
case IMG_BMP: return imagebmp($this->image);
case IMG_GIF: return imagegif($this->image);
case IMG_JPG: return imagejpeg($this->image, null, 90);
case IMG_PNG: return imagepng($this->image);
case IMG_WEBP: return imagewebp($this->image);
case IMG_XPM: return imagexbm($this->image, null);
case IMAGETYPE_BMP: return imagebmp($this->image);
case IMAGETYPE_GIF: return imagegif($this->image);
case IMAGETYPE_JPEG: return imagejpeg($this->image, null, 90);
case IMAGETYPE_PNG: return imagepng($this->image);
case IMAGETYPE_WEBP: return imagewebp($this->image);
case IMAGETYPE_XBM: return imagexbm($this->image, null);
}
}

function type(): string {
switch($this->type) {
case IMG_BMP: return 'bmp';
case IMG_GIF: return 'gif';
case IMG_JPG: return 'jpg';
case IMG_PNG: return 'png';
case IMG_WEBP: return 'webp';
case IMG_XPM: return 'xpm';
case IMAGETYPE_BMP: return 'bmp';
case IMAGETYPE_GIF: return 'gif';
case IMAGETYPE_JPEG: return 'jpg';
case IMAGETYPE_PNG: return 'png';
case IMAGETYPE_WEBP: return 'webp';
case IMAGETYPE_XBM: return 'xpm';
default: return 'error';
}
}
Expand Down

0 comments on commit ee837b5

Please sign in to comment.