src/Captcha/Captcha.php
private function calculateDimensions()
	{
		# calculate capatcha text box dimensions
		# which are the minimum image resource dimensions
	
		$this->_calculated_text_box['dimensions'] = $this->getTextBoxDimensions(
														$this->_background_text['size'],
														0,
														$this->_background_text['font'],
														$this->_code
														);

		# calculate how much each character takes from width
		$this->_calculated_text_box['char_width'] = $this->_calculated_text_box['dimensions']['width'] / $this->_code_length;

		# calculate additional width to add to the minimum text box width later
		$this->_calculated_text_box['additional_width'] = $this->_calculated_text_box['char_width'] * $this->_code_length + $this->_blocks_seperation;

		$this->_calculated_text_box['additional_height'] = rand( 5, 15 );	
		
		# set Initial Image Information width, height
		
		$this->_image_info['width']  = $this->_calculated_text_box['dimensions']['width']  + $this->_calculated_text_box['additional_width'];
			
		$this->_image_info['height'] = $this->_calculated_text_box['dimensions']['height'] + $this->_calculated_text_box['additional_height'];
		
		
		# Method End
	}
private function calculateDimensions()
	{
		# calculate capatcha text box dimensions
		# which are the minimum image resource dimensions
	
		$this->_calculated_text_box['dimensions'] = $this->getTextBoxDimensions(
														$this->_background_text['size'],
														0,
														$this->_background_text['font'],
														$this->_code
														);

		# calculate how much each character takes from width
		$this->_calculated_text_box['char_width'] = $this->_calculated_text_box['dimensions']['width'] / $this->_code_length;

		# calculate additional width to add to the minimum text box width later
		$this->_calculated_text_box['additional_width'] = $this->_calculated_text_box['char_width'] * $this->_code_length + $this->_blocks_seperation;

		$this->_calculated_text_box['additional_height'] = rand( 5, 15 );	
		
		# set Initial Image Information width, height
		
		$this->_image_info['width']  = $this->_calculated_text_box['dimensions']['width']  + $this->_calculated_text_box['additional_width'];
			
		$this->_image_info['height'] = $this->_calculated_text_box['dimensions']['height'] + $this->_calculated_text_box['additional_height'];
		
		
		# Method End
	}
private function calculateDimensions ( ) { # calculate capatcha text box dimensions # which are the minimum image resource dimensions $ this -> _calculated_text_box [ 'dimensions' ] = $ this -> getTextBoxDimensions ( $ this -> _background_text [ 'size' ] , 0 , $ this -> _background_text [ 'font' ] , $ this -> _code ) ; # calculate how much each character takes from width $ this -> _calculated_text_box [ 'char_width' ] = $ this -> _calculated_text_box [ 'dimensions' ] [ 'width' ] / $ this -> _code_length ; # calculate additional width to add to the minimum text box width later $ this -> _calculated_text_box [ 'additional_width' ] = $ this -> _calculated_text_box [ 'char_width' ] * $ this -> _code_length + $ this -> _blocks_seperation ; $ this -> _calculated_text_box [ 'additional_height' ] = rand ( 5 , 15 ) ; # set Initial Image Information width, height $ this -> _image_info [ 'width' ] = $ this -> _calculated_text_box [ 'dimensions' ] [ 'width' ] + $ this -> _calculated_text_box [ 'additional_width' ] ; $ this -> _image_info [ 'height' ] = $ this -> _calculated_text_box [ 'dimensions' ] [ 'height' ] + $ this -> _calculated_text_box [ 'additional_height' ] ; # Method End }
calculate required size of capatcha image
calculate required size of capatcha image