lib/FastImageSize.php
public function getImageSize($file, $type = '')
	{
		// Reset values
		$this->resetValues();

		// Treat image type as unknown if extension or mime type is unknown
		if (!preg_match('/\.([a-z0-9]+)$/i', $file, $match) && empty($type))
		{
			$this->getImagesizeUnknownType($file);
		}
		else
		{
			$extension = (empty($type) && isset($match[1])) ? $match[1] : preg_replace('/.+\/([a-z0-9-.]+)$/i', '$1', $type);

			$this->getImageSizeByExtension($file, $extension);
		}

		return sizeof($this->size) > 1 ? $this->size : false;
	}
public function getImageSize($file, $type = '')
	{
		// Reset values
		$this->resetValues();

		// Treat image type as unknown if extension or mime type is unknown
		if (!preg_match('/\.([a-z0-9]+)$/i', $file, $match) && empty($type))
		{
			$this->getImagesizeUnknownType($file);
		}
		else
		{
			$extension = (empty($type) && isset($match[1])) ? $match[1] : preg_replace('/.+\/([a-z0-9-.]+)$/i', '$1', $type);

			$this->getImageSizeByExtension($file, $extension);
		}

		return sizeof($this->size) > 1 ? $this->size : false;
	}
public function getImageSize ( $ file , $ type = '' ) { // Reset values $ this -> resetValues ( ) ; // Treat image type as unknown if extension or mime type is unknown if ( ! preg_match ( '/\.([a-z0-9]+)$/i' , $ file , $ match ) && empty ( $ type ) ) { $ this -> getImagesizeUnknownType ( $ file ) ; } else { $ extension = ( empty ( $ type ) && isset ( $ match [ 1 ] ) ) ? $ match [ 1 ] : preg_replace ( '/.+\/([a-z0-9-.]+)$/i' , '$1' , $ type ) ; $ this -> getImageSizeByExtension ( $ file , $ extension ) ; } return sizeof ( $ this -> size ) > 1 ? $ this -> size : false ; }
Get image dimensions of supplied image

@param string $file Path to image that should be checked
@param string $type Mimetype of image
@return array|bool Array with image dimensions if successful, false if not
Get image dimensions of supplied image