private function getQuality($quality, $extension) {

		if(false === ('-' . intval($quality) == '-' . $quality)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($quality)), E_USER_ERROR);
		}

		if(false === is_string($extension)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($extension)), E_USER_ERROR);
		}

		if(strtolower($extension) === 'png' && $quality > 9) {
			$quality = floor(($quality - 1) / 10);
		}

		return $quality;
	}
private function getQuality($quality, $extension) {

		if(false === ('-' . intval($quality) == '-' . $quality)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($quality)), E_USER_ERROR);
		}

		if(false === is_string($extension)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($extension)), E_USER_ERROR);
		}

		if(strtolower($extension) === 'png' && $quality > 9) {
			$quality = floor(($quality - 1) / 10);
		}

		return $quality;
	}
private function getQuality ( $ quality , $ extension ) { if ( false === ( '-' . intval ( $ quality ) == '-' . $ quality ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type integer, "%s" given' , __METHOD__ , gettype ( $ quality ) ) , E_USER_ERROR ) ; } if ( false === is_string ( $ extension ) ) { return trigger_error ( sprintf ( 'Argument 2 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ extension ) ) , E_USER_ERROR ) ; } if ( strtolower ( $ extension ) === 'png' && $ quality > 9 ) { $ quality = floor ( ( $ quality - 1 ) / 10 ) ; } return $ quality ; }
Validates and returns quality based on image extension
@param int $quality
@param string $extension
@return int
Validates and returns quality based on image extension