Server : LiteSpeed System : Linux server335.web-hosting.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : cardxfeb ( 2452) PHP Version : 8.1.34 Disable Function : NONE Directory : /home/cardxfeb/public_html/vendor/spatie/image-optimizer/src/ |
<?php
namespace Spatie\ImageOptimizer;
use InvalidArgumentException;
class Image
{
protected $pathToImage = '';
public function __construct(string $pathToImage)
{
if (! file_exists($pathToImage)) {
throw new InvalidArgumentException("`{$pathToImage}` does not exist");
}
$this->pathToImage = $pathToImage;
}
public function mime(): string
{
return mime_content_type($this->pathToImage);
}
public function path(): string
{
return $this->pathToImage;
}
public function extension(): string
{
$extension = pathinfo($this->pathToImage, PATHINFO_EXTENSION);
return strtolower($extension);
}
}