AMP_Image_Dimension_Extractor::fetch_images_via_fast_image PHP Метод

fetch_images_via_fast_image() приватный статический Метод

Fetch images via FastImage library
private static fetch_images_via_fast_image ( array $urls_to_fetch, array &$images )
$urls_to_fetch array Image src urls to fetch.
$images array Array to populate with results of image/dimension inspection.
    private static function fetch_images_via_fast_image($urls_to_fetch, &$images)
    {
        require_once AMP__DIR__ . '/includes/lib/class-fastimage.php';
        $image = new FastImage();
        $urls = array();
        // array_column doesn't exist in PHP 5.2.
        foreach ($urls_to_fetch as $key => $value) {
            $urls[] = $key;
        }
        foreach ($urls as $url) {
            $result = $image->load($url);
            if (false === $result) {
                $images[$url]['size'] = self::STATUS_IMAGE_EXTRACTION_FAILED;
            } else {
                $size = $image->getSize();
                $images[$url]['size'] = $size;
            }
        }
    }