src/classes/CCImage.php
protected function set_type( $type, $overwrite = true )
	{
		if ( !is_null( $type ) )
		{
			if ( !in_array( $type, static::$available_image_types ) )
			{
				throw new CCException( "CCImage - Invalid image type '".$type."'." );
			}

			// don't allow jpg, set to jpeg
			if ( $type === 'jpg' )
			{
				$type = 'jpeg';
			}

			if ( $overwrite )
			{
				$this->type = $type;
			}
		}

		return $type;
	}
protected function set_type( $type, $overwrite = true )
	{
		if ( !is_null( $type ) )
		{
			if ( !in_array( $type, static::$available_image_types ) )
			{
				throw new CCException( "CCImage - Invalid image type '".$type."'." );
			}

			// don't allow jpg, set to jpeg
			if ( $type === 'jpg' )
			{
				$type = 'jpeg';
			}

			if ( $overwrite )
			{
				$this->type = $type;
			}
		}

		return $type;
	}
protected function set_type ( $ type , $ overwrite = true ) { if ( ! is_null ( $ type ) ) { if ( ! in_array ( $ type , static :: $ available_image_types ) ) { throw new CCException ( "CCImage - Invalid image type '" . $ type . "'." ) ; } // don't allow jpg, set to jpeg if ( $ type === 'jpg' ) { $ type = 'jpeg' ; } if ( $ overwrite ) { $ this -> type = $ type ; } } return $ type ; }
Set the current image type

@param string 		$type		The new image type
@param string 		$overwrite	Should the image keep this type?
@return string
Set the current image type