lib/PHPRtfLite/Image.php
public static function createFromFile(PHPRtfLite $rtf, $file, $width = null, $height = null)
    {
        if (is_readable($file)) {
            $stream = fopen($file, 'rb');
            $pathInfo = pathinfo($file);
            $type = isset($pathInfo['extension']) ? strtolower($pathInfo['extension']) : 'jpeg';
            $image = self::create($rtf, $stream, $type, $width, $height);

            if ($type != self::TYPE_WMF) {
                list($width, $height, $imageType) = getimagesize($file);
                $imageType = image_type_to_extension($imageType, false);
                $image->setImageWidth($width);
                $image->setImageHeight($height);
                if ($type != $imageType) {
                    $image->setImageType($imageType);
                }
            }
            return $image;
        }

        return self::createMissingImage($rtf, $width, $height);
    }
public static function createFromFile(PHPRtfLite $rtf, $file, $width = null, $height = null)
    {
        if (is_readable($file)) {
            $stream = fopen($file, 'rb');
            $pathInfo = pathinfo($file);
            $type = isset($pathInfo['extension']) ? strtolower($pathInfo['extension']) : 'jpeg';
            $image = self::create($rtf, $stream, $type, $width, $height);

            if ($type != self::TYPE_WMF) {
                list($width, $height, $imageType) = getimagesize($file);
                $imageType = image_type_to_extension($imageType, false);
                $image->setImageWidth($width);
                $image->setImageHeight($height);
                if ($type != $imageType) {
                    $image->setImageType($imageType);
                }
            }
            return $image;
        }

        return self::createMissingImage($rtf, $width, $height);
    }
public static function createFromFile ( PHPRtfLite $ rtf , $ file , $ width = null , $ height = null ) { if ( is_readable ( $ file ) ) { $ stream = fopen ( $ file , 'rb' ) ; $ pathInfo = pathinfo ( $ file ) ; $ type = isset ( $ pathInfo [ 'extension' ] ) ? strtolower ( $ pathInfo [ 'extension' ] ) : 'jpeg' ; $ image = self :: create ( $ rtf , $ stream , $ type , $ width , $ height ) ; if ( $ type != self :: TYPE_WMF ) { list ( $ width , $ height , $ imageType ) = getimagesize ( $ file ) ; $ imageType = image_type_to_extension ( $ imageType , false ) ; $ image -> setImageWidth ( $ width ) ; $ image -> setImageHeight ( $ height ) ; if ( $ type != $ imageType ) { $ image -> setImageType ( $ imageType ) ; } } return $ image ; } return self :: createMissingImage ( $ rtf , $ width , $ height ) ; }
creates rtf image from file

@param   PHPRtfLite              $rtf
@param   string                  $file
@param   float                   $width  optional
@param   float                   $height optional
@return  PHPRtfLite_Image
creates rtf image from file