lib/Type/TypeJpeg.php
protected function getSizeInfo()
	{
		$size = array();
		// since we check $i + 1 we need to stop one step earlier
		$this->dataLength = strlen($this->data) - 1;

		$sofStartRead = true;

		// Look through file for SOF marker
		for ($i = 2; $i < $this->dataLength; $i++)
		{
			$marker = $this->getNextMarker($i, $sofStartRead);

			if (in_array($marker, $this->sofMarkers))
			{
				// Extract size info from SOF marker
				return $this->extractSizeInfo($i);
			}
			else
			{
				// Extract length only
				$markerLength = $this->extractMarkerLength($i);

				if ($markerLength < 2)
				{
					return $size;
				}

				$i += $markerLength - 1;
				continue;
			}
		}

		return $size;
	}
protected function getSizeInfo()
	{
		$size = array();
		// since we check $i + 1 we need to stop one step earlier
		$this->dataLength = strlen($this->data) - 1;

		$sofStartRead = true;

		// Look through file for SOF marker
		for ($i = 2; $i < $this->dataLength; $i++)
		{
			$marker = $this->getNextMarker($i, $sofStartRead);

			if (in_array($marker, $this->sofMarkers))
			{
				// Extract size info from SOF marker
				return $this->extractSizeInfo($i);
			}
			else
			{
				// Extract length only
				$markerLength = $this->extractMarkerLength($i);

				if ($markerLength < 2)
				{
					return $size;
				}

				$i += $markerLength - 1;
				continue;
			}
		}

		return $size;
	}
protected function getSizeInfo ( ) { $ size = array ( ) ; // since we check $i + 1 we need to stop one step earlier $ this -> dataLength = strlen ( $ this -> data ) - 1 ; $ sofStartRead = true ; // Look through file for SOF marker for ( $ i = 2 ; $ i < $ this -> dataLength ; $ i ++ ) { $ marker = $ this -> getNextMarker ( $ i , $ sofStartRead ) ; if ( in_array ( $ marker , $ this -> sofMarkers ) ) { // Extract size info from SOF marker return $ this -> extractSizeInfo ( $ i ) ; } else { // Extract length only $ markerLength = $ this -> extractMarkerLength ( $ i ) ; if ( $ markerLength < 2 ) { return $ size ; } $ i += $ markerLength - 1 ; continue ; } } return $ size ; }
Get size info from image data

@return array An array with the image's size info or an empty array if
size info couldn't be found
Get size info from image data