method getExtension documentation in bbn\File\Image
Returns the extension of the image. If the file has jpg extension will return 'jpeg'.
Example
$img = new bbn\File\Image("/home/data/test/image.jpg");
bbn\X::dump($img->getExtension());
// (string) "jpeg"
function()
{
parent::getExtension();
if (!$this->ext2 && $this->file) {
if (function_exists('exif_imagetype')) {
if (exif_imagetype($this->file)) {
if (!in_array($this->ext, bbn\File\Image::$allowed_extensions)) {
$this->ext = false;
}
}
else{
$this->ext = false;
}
}
if ($this->ext) {
$this->ext2 = $this->ext;
if ($this->ext2 === 'jpg') {
$this->ext2 = 'jpeg';
}
}
}
return $this->ext;
}
Returns the extension of the image. If the file has jpg extension will return 'jpeg'. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions