(non-PHPdoc)
@see \Thumbnailer\Thumbnailer\ThumbnailerInterface::parseImageInfo()
506331
public function parseImageInfo() 
    {
    	if (null === $this->sourceImagePath) {
    		throw new NoSourceException();
    	}
    	
    	$pathinfo = pathinfo($this->sourceImagePath);
    	if (!is_array($pathinfo)) {
    		throw new \RuntimeException("It is not possible to correctly get pathinfo for the image file '" . $this->sourceImagePath . "' ");
    	}
        
        $imagesize = getimagesize($this->sourceImagePath);
        if (!is_array($imagesize)) {
            throw new \RuntimeException("It is not possible to correctly get imagesize for the image file '" . $this->sourceImagePath . "' ");
        }
    	
    	$info = $pathinfo + $imagesize;
        
        if (isset($info[0])) {
            $info['width'] = $info[0];
        } else {
            throw new \RuntimeException("Unable to get width for the image file '" . $this->sourceImagePath . "' ");
        }
        
        if (isset($info[1])) {
            $info['height'] = $info[1];
        } else {
            throw new \RuntimeException("Unable to get height for the image file '" . $this->sourceImagePath . "' ");
        }
        
        if (!isset($info['mime'])) {
            throw new \RuntimeException("Unable to get mimetype for the image file '" . $this->sourceImagePath . "' ");
        }

        unset($info[0], $info[1], $info[2], $info[3]);
        
        switch(strtolower($info['mime'])) {
		case 'image/png':
			$info['extension'] = 'png';
            break;
            
		case 'image/jpeg':
			$info['extension'] = 'jpg';
            break;
            
		case 'image/gif':
			$info['extension'] = 'gif';
            break;
            
		default:
			throw new \RuntimeException("Unable to get extension for the image file '" . $this->sourceImagePath . "' ");
            break;
        }
    	
        // We set the default width/height values for the destination image if resize is not called
        $this->destImageWidth = $info['width'];
        $this->destImageHeight = $info['height'];
        
        $this->setExtension($info['extension']);
        $this->imageInfo = $info;
        
    	return $this;
    }
786768
protected function _image($val)
    {
        $DEBUGCSS = $this->_dompdf->getOptions()->getDebugCss();
        $parsed_url = "none";

        if (mb_strpos($val, "url") === false) {
            $path = "none"; //Don't resolve no image -> otherwise would prefix path and no longer recognize as none
        } else {
            $val = preg_replace("/url\(\s*['\"]?([^'\")]+)['\"]?\s*\)/", "\\1", trim($val));

            // Resolve the url now in the context of the current stylesheet
            $parsed_url = Helpers::explode_url($val);
            if ($parsed_url["protocol"] == "" && $this->get_protocol() == "") {
                if ($parsed_url["path"][0] === '/' || $parsed_url["path"][0] === '\\') {
                    $path = $_SERVER["DOCUMENT_ROOT"] . '/';
                } else {
                    $path = $this->get_base_path();
                }

                $path .= $parsed_url["path"] . $parsed_url["file"];
                $path = realpath($path);
                // If realpath returns FALSE then specifically state that there is no background image
                // FIXME: Is this causing problems for imported CSS files? There are some './none' references when running the test cases.
                if (!$path) {
                    $path = 'none';
                }
            } else {
                $path = Helpers::build_url($this->get_protocol(),
                    $this->get_host(),
                    $this->get_base_path(),
                    $val);
            }
        }

        if ($DEBUGCSS) {
            print "<pre>[_image\n";
            print_r($parsed_url);
            print $this->get_protocol() . "\n" . $this->get_base_path() . "\n" . $path . "\n";
            print "_image]</pre>";;
        }

        return $path;
    }
665006
public function getImageAsString()
    {
        $data = null;
        ob_start();
        $this->show(true);
        $data = ob_get_contents();
        ob_end_clean();

        return $data;
    }
466023
function load()
    {
        if ( $this->ImageObject !== null and
             $this->ImageObjectRef !== null )
            return;
        switch( $this->StoredType )
        {
            case 'png':
            {
                return $this->loadPNG( $this->StoredPath, $this->StoredFile );
            } break;

            case 'jpg':
            {
                return $this->loadJPEG( $this->StoredPath, $this->StoredFile );
            } break;

            case 'gif':
            {
                return $this->loadGIF( $this->StoredPath, $this->StoredFile );
            } break;

            default:
            {
                if ( @$this->loadPNG( $this->StoredPath, $this->StoredFile ) )
                    return true;
                else if ( @$this->loadJPEG( $this->StoredPath, $this->StoredFile ) )
                    return true;
                else if ( @$this->loadGIF( $this->StoredPath, $this->StoredFile ) )
                    return true;
                eZDebug::writeError( 'Image format not supported: ' . $this->StoredType, __METHOD__ );
            }
        }
        return false;
    }
1018909
public function getMageNowForDb()
    {
        $dt = $this->getMageNow();
        $result = $this->hlpFormat->dateTimeForDb($dt);
        return $result;
    }
479982
public function enregistreSelectionImagePrincipale($params = array())
    {
        $authentification = new archiAuthentification();
        if ($authentification->estConnecte() && isset($this->variablesGet['idEvenement']) && $this->variablesGet['idEvenement']!='' && isset($this->variablesGet['idImage']) && $this->variablesGet['idImage']!='') {
            $idEvenementGroupeAdresse = $this->getIdEvenementGroupeAdresseFromIdEvenement($this->variablesGet['idEvenement']);
            $idAdresse = $this->getIdAdresseFromIdEvenementGroupeAdresse($idEvenementGroupeAdresse);

            // recherche de l'historiqueEvenement de l'evenement groupe adresse
            $reqHistorique = "
					SELECT he1.idEvenement as idHistoriqueEvenement
					FROM evenements he2, evenements he1
					WHERE he1.idEvenement = '".$idEvenementGroupeAdresse."'
							AND he2.idEvenement = he1.idEvenement
							GROUP BY he1.idEvenement
							";

            $resHistorique = $this->connexionBdd->requete($reqHistorique);

            if (mysql_num_rows($resHistorique)==1) {
                $fetchHistorique = mysql_fetch_assoc($resHistorique);

                $idHistoriqueEvenement = $fetchHistorique['idHistoriqueEvenement'];

                $reqUpdate = "UPDATE evenements SET idImagePrincipale='".$this->variablesGet['idImage']."' WHERE idEvenement = '".$idHistoriqueEvenement."'";
                $resUpdate = $this->connexionBdd->requete($reqUpdate);
                echo "Image selectionnée<br>";
                header("Location: ".$this->creerUrl('', '', array('archiAffichage'=>'adresseDetail', 'archiIdAdresse'=>$idAdresse, 'archiIdEvenementGroupeAdresse'=>$idEvenementGroupeAdresse), false, false));
            } else {
                echo "Erreur de recupération de groupe d'adresse, merci de contacter l'administrateur<br>";
            }
        }
    }
846010
protected function createImageResource($image, $imageInfo)
	{
		switch($imageInfo[2])
		{
			case IMAGETYPE_JPEG:
				return imagecreatefromjpeg($image);
				break;
			case IMAGETYPE_GIF:
				return imagecreatefromgif($image);
				break;
			case IMAGETYPE_PNG:
				return imagecreatefrompng($image);
				break;
			default:
				throw new RuntimeException(vsprintf('Unable to open [ %s ]. Unsupported image type.', [pathinfo($image, PATHINFO_EXTENSION)]));
		}
	}
304613
protected function parseUserInfo()
    {
        // No user information? we're done
        if (null === $this->userInfo) {
            return;
        }

        // If no ':' separator, we only have a username
        if (false === strpos($this->userInfo, ':')) {
            $this->setUser($this->userInfo);

            return;
        }

        // Split on the ':', and set both user and password
        list($user, $password) = explode(':', $this->userInfo, 2);
        $this->setUser($user);
        $this->setPassword($password);
    }
808632
def _parse_photo(photo):
    """"""
    owner = User(photo.owner)
    title = photo.title
    ispublic = photo.ispublic
    isfriend = photo.isfriend
    isfamily = photo.isfamily
    secret = photo.secret
    server = photo.server
    p = Photo(photo.id, owner=owner, title=title, ispublic=ispublic,\
              isfriend=isfriend, isfamily=isfamily, secret=secret, \
              server=server)        
    return p
1040856
protected function parseFilter()
    {
        if (isset($this->input['filter'])) {
            $fragments  = preg_split('%:%', $this->input['filter'], -1, PREG_SPLIT_NO_EMPTY);
            $this->parameter['filter'] = $this->parseImageFilter($fragments);

            return;
        }

        $this->parameter['filter'] = [];
    }
1167673
protected function _parseGravatarCallback($m) {
        if (preg_match('#^\$#', $m[1])) {
            foreach ($this->_template->vars as $key => $val) {
                if (substr($m[1], 1, strlen($m[1])) == $key) {
                    $m[1] = preg_replace('`' . $key . '`', $val, $m[1]);
                    $m[1] = substr($m[1], 1, strlen($m[1]));
                }
            }
        }
        if (isset($m[2]) && preg_match('#^\$#', $m[2])) {
            foreach ($this->_template->vars as $key => $val) {
                if (substr($m[2], 1, strlen($m[2])) == $key) {
                    $m[2] = preg_replace('`' . $key . '`', $val, $m[2]);
                    $m[2] = substr($m[2], 1, strlen($m[2]));
                }
            }
        }
        else {
            $m[2] = 100;
        }

        if (preg_match('#\'#', $m[1])) {
            $m[1] = preg_replace('#\'#', '"', $m[1]);

            return '<?php echo \'http://secure.gravatar.com/avatar/\'.md5(' . $m[1] . ').\'?s=' . $m[2] . '&d=identicon\'; ?>';
        }
        else {
            return '<?php echo \'http://secure.gravatar.com/avatar/\'.md5("' . $m[1] . '").\'?s=' . $m[2] . '&d=identicon\'; ?>';
        }
    }
1197091
public function outputImageInfo(SourceImage $sourceImage, OutputInterface $output)
    {
        $output->writeln([
            '  Hash: <info>'.$sourceImage->hash.'</info>',
            '  Organization: <info>'.$sourceImage->organization.'</info>',
            '  Name: <info>'.$sourceImage->name.'</info>',
            '  Size: <info>'.$sourceImage->size.'</info>',
            '  Format: <info>'.$sourceImage->format.'</info>',
            '  Created: <info>'.$sourceImage->created->format('Y-m-d H:i:s').'</info>',
            '  Dimensions: <info>'.$sourceImage->width.'x'.$sourceImage->height.'</info>',
        ]);

        if ($output->isVerbose()) {
            $output->writeln('  BinaryHash: <info>'.$sourceImage->binaryHash.'</info>');
        }

        if (!empty($sourceImage->dynamicMetadata)) {
            if (!$output->isVerbose()) {
                $metaNames = array_keys($sourceImage->dynamicMetadata);
                $output->writeln('  DynamicMetadatas ('.\count($metaNames).'): '.implode(', ', $metaNames));
            } else {
                $output->writeln('  DynamicMetadatas:');
                /** @var DynamicMetadataInterface $meta */
                foreach ($sourceImage->dynamicMetadata as $name => $meta) {
                    $output->writeln('     - <info>'.$name.'</info> '.$this->formatDynamicMetadata($meta));
                }
            }
        }
    }
183185
function getImageId(){
		$ary = explode('/',$this->_image_id); // "75c/75c1/" -> ["75c","75c1",""]
		if(isset($ary[1])){
			return (int)hexdec($ary[1]);
		}
	}
772973
function callImage( $info )
    {
        $params = array();
        $leftMargin = false;
        $rightMargin = false;

        eZPDFTable::extractParameters( $info['p'], 0, $params, true );

        $filename = rawurldecode( $params['src'] );

        $mimetype = eZMimeType::findByFileContents( $filename );

        $this->transaction( 'start' );

        if ( !isset( $params['static'] ) )
        {
            $params['static'] = false;
        }

        if ( $this->yOffset()-$params['height'] < $this->ez['bottomMargin'] )
        {
            $this->ezNewPage();
        }

        if ( isset( $params['dpi'] ) )
        {
            $newWidth = (int)( $params['width'] * ( (int)$params['dpi'] / 72 ) );
            $newHeight = (int)( $params['height'] * ( (int)$params['dpi'] / 72 ) );
            $newFilename = eZSys::cacheDirectory() . '/' . md5( mt_rand() ) . '.jpg';
            while( file_exists( $newFilename ) )
            {
                $newFilename = eZSys::cacheDirectory() . '/' . md5( mt_rand() ) . '.jpg';
            }

            $img = eZImageManager::factory();
            $newImg = $img->convert( $filename,
                                     $newFilename,
                                     false,
                                     array( 'filters' => array( array( 'name' => 'geometry/scaledownonly',
                                                                       'data' => array( $newWidth, $newHeight ) ) ) ) );
            $filename = $newFilename['url'];
        }

        $drawableAreaWidth = $this->ez['pageWidth'] - $this->ez['leftMargin'] - $this->ez['rightMargin'];

        switch( $params['align'] )
        {
            case 'right':
            {
                $xOffset = $this->ez['pageWidth'] - ( $this->rightMargin() + $params['width'] );
                $rightMargin = $this->rightMargin() + $params['width'];
                if ( $rightMargin > ( $drawableAreaWidth + $this->rightMargin() ) )
                {
                    // the image is equal or larger then width of the page(of the drawable area) => no point
                    // to set $rightMargin and next object(text, image, ...) should be outputted below the image.
                    $rightMargin = false;
                }
            } break;

            case 'center':
            {
                $xOffset = ( $this->ez['pageWidth'] - $this->rightMargin() - $this->leftMargin() ) / 2 + $this->leftMargin() - $params['width'] / 2;
            } break;

            case 'left':
            default:
            {
                $xOffset = $this->leftMargin();
                $leftMargin = $this->leftMargin() + $params['width'];
                if ( $leftMargin > ( $drawableAreaWidth + $this->leftMargin() ) )
                {
                    // the image is equal or larger then width of the page(of the drawable area) => no point
                    // to set $leftMargin and next object(text, image, ...) should be outputted below the image.
                    $leftMargin = false;
                }

            } break;
        }

        if ( isset( $params['x'] ) )
        {
            $xOffset = $params['x'];
            $leftMargin = false;
            $rightMargin = false;
        }

        $yOffset = $this->yOffset();
        $whileCount = 0;

        if ( $params['width'] < $drawableAreaWidth )
        {
            while ( $this->leftMargin( $yOffset ) > $xOffset &&
                    ++$whileCount < 100 )
            {
                $yOffset -= 10;
            }
        }

        $yOffset -= $params['height'];
        $yOffset += $this->lineHeight()/2;
        if ( isset( $params['y'] ) )
        {
            $yOffset = $params['y'];
        }

        if ( $leftMargin !== false )
        {
            $this->setLimitedLeftMargin( $yOffset - 7, $yOffset + $params['height'] + 7, $leftMargin + 7 );
        }
        if ( $rightMargin !== false )
        {
            $this->setLimitedRightMargin( $yOffset- 7, $yOffset + $params['height'] + 7, $rightMargin + 7 );
        }

        switch( $mimetype['name'] )
        {
            case 'image/gif':
            {
                $newFilename = eZSys::cacheDirectory() . '/' . md5( mt_rand() ) . '.jpg';
                while( file_exists( $newFilename ) )
                {
                    $newFilename = eZSys::cacheDirectory() . '/' . md5( mt_rand() ) . '.jpg';
                }
                $newMimetype = eZMimeType::findByURL( $newFilename );

                $img = eZImageManager::factory();
                $newImg = $img->convert( $mimetype,
                                         $newMimetype,
                                         false,
                                         array() );
                $this->addJpegFromFile( $newMimetype['url'],
                                        $xOffset,
                                        $yOffset,
                                        $params['width'],
                                        $params['height'] );
            } break;

            case 'image/jpeg':
            {
                $this->addJpegFromFile( $filename,
                                        $xOffset,
                                        $yOffset,
                                        $params['width'],
                                        $params['height'] );
            } break;

            case 'image/png':
            {
                if ( $this->addPngFromFile( $filename,
                                            $xOffset,
                                            $yOffset,
                                            $params['width'],
                                            $params['height'] ) === false )
                {
                    $this->transaction('abort');
                    return;
                }
            } break;

            default:
            {
                eZDebug::writeError( 'Unsupported image file type, '. $mimetype['name'], __METHOD__ );
                $this->transaction( 'abort' );
                return;
            } break;
        }

        $this->transaction( 'commit' );

        if ( !$leftMargin && !$rightMargin  && !$params['static'] )
        {
            $this->y -= $params['height'] + $this->lineHeight();
        }

        return array( 'y' => $params['height'] + $this->lineHeight() );
    }
1349012
public function parsePhotos($id = null)
    {
        $url = (isset($id)) ? '/extradata/public/users/' . $id . '/photos' : '/extradata/public/photos';
        list($data) = $this->_callUrl($this->api_base . $url, true);

        $photos = array();

        if ($data) {
            foreach ($data as $photo_data) {
                $temp_photo = new Photo();
                $temp_photo->parse($photo_data);
                $photos[] = $temp_photo;
                unset($temp_photo);
            }
        }

        return $photos;
    }
1059808
static function readfile($pic)
    {
        $image_info = getimagesize($pic);
        if ($image_info["mime"] == "image/jpeg" || $image_info["mime"] == "image/gif" || $image_info["mime"] == "image/png")
        {
            switch ($image_info["mime"])
            {
                case "image/jpeg":
                    $im = imagecreatefromjpeg($pic);
                    break;
                case "image/gif":
                    $im = imagecreatefromgif($pic);
                    break;
                case "image/png":
                    $im = imagecreatefrompng($pic);
                    break;
            }
            return $im;
        }
        return false;
    }
832143
public static function castImageInfo(Image\Info $info, array $a, Stub $stub, $isNested, $filter = 0)
    {
        $a[Caster::PREFIX_VIRTUAL . 'width'] = $info->getWidth();
        $a[Caster::PREFIX_VIRTUAL . 'height'] = $info->getHeight();

        return $a;
    }