Retrieve image urls from an incoming message.

@return array A download for the image file.
9962
public function getImagesUrls()
    {
        return Collection::make($this->event->get('attachments'))->where('contentType', 'image')->map(function ($item) {
            return new Image($item['contentUrl'], $item);
        })->toArray();
    }
241640
public function getImageUrl()
    {
        if(array_key_exists(self::ITEM_IMAGE_URL, $this->_itemData)) {
            return (string) $this->_itemData[self::ITEM_IMAGE_URL];
        }
        return null;
    }
793675
public function getMessages()
    {
        $message = new IncomingMessage(File::PATTERN, $this->event->get('from')['id'], $this->event->get('conversation')['id'],
            $this->payload);
        $message->setFiles($this->getAttachmentUrls());

        return [$message];
    }
225042
public function getImage()
    {
        // No fields, no image.
        if (empty($this->contenttype['fields'])) {
            return '';
        }

        // Grab the first field of type 'image', and return that.
        foreach ($this->contenttype['fields'] as $key => $field) {
            if ($field['type'] === 'image' && isset($this->values[$key])) {
                // After v1.5.1 we store image data as an array
                if (is_array($this->values[$key])) {
                    return isset($this->values[$key]['file']) ? $this->values[$key]['file'] : '';
                }

                return $this->values[$key];
            }
        }

        // otherwise, no image.
        return '';
    }
1076889
public function getImageList() {
		$listString = $this->orderedImages;
		if (!$listString) {
			return [];
		}
		$list = unserialize($listString);

		// if empty don't need to check the permissions.
		if (!$list) {
			return [];
		}

		// check access levels
		$guidsString = implode(',', $list);

		$list = elgg_get_entities([
			'wheres' => ["e.guid IN ($guidsString)"],
			'order_by' => "FIELD(e.guid, $guidsString)",
			'callback' => 'tp_guid_callback',
			'limit' => false,
		]);
		return $list;
	}
151078
public function getImageUrl()
    {
        return !$this->hasImage() ?
            $this->getImageDefaultUrl() :
            $this->_imageUrl($this->owner->getAttribute($this->imageAttribute));
    }
1133222
public static function download_lorem_image()
    {
        $url = 'http://lorempixel.com/1024/768?t='.uniqid();
        $img_filename = "mock-file-".uniqid().".jpeg";

        $img = self::get_mock_folder()->getFullPath().$img_filename;

        if (ini_get('allow_url_fopen')) {
            file_put_contents($img, file_get_contents($url));
        } else {
            $ch = curl_init($url);
            $fp = fopen($img, 'wb');
            curl_setopt($ch, CURLOPT_FILE, $fp);
            curl_setopt($ch, CURLOPT_HEADER, 0);
            curl_exec($ch);
            curl_close($ch);
            fclose($fp);
        }

        if (!file_exists($img) || !filesize($img)) {
            return false;
        }

        $i = Image::create();
        $i->Filename = self::get_mock_folder()->Filename.$img_filename;
        $i->Title = $img_filename;
        $i->Name = $img_filename;
        $i->ParentID = self::get_mock_folder()->ID;
        $i->write();

        return $i;
    }
319686
public function getImages() {
    	// Sort array
    	$images = array();
    	if (isset($this->_headerFooterImages[self::IMAGE_HEADER_LEFT])) 	$images[self::IMAGE_HEADER_LEFT] = 		$this->_headerFooterImages[self::IMAGE_HEADER_LEFT];
    	if (isset($this->_headerFooterImages[self::IMAGE_HEADER_CENTER])) 	$images[self::IMAGE_HEADER_CENTER] = 	$this->_headerFooterImages[self::IMAGE_HEADER_CENTER];
    	if (isset($this->_headerFooterImages[self::IMAGE_HEADER_RIGHT])) 	$images[self::IMAGE_HEADER_RIGHT] = 	$this->_headerFooterImages[self::IMAGE_HEADER_RIGHT];
    	if (isset($this->_headerFooterImages[self::IMAGE_FOOTER_LEFT])) 	$images[self::IMAGE_FOOTER_LEFT] = 		$this->_headerFooterImages[self::IMAGE_FOOTER_LEFT];
    	if (isset($this->_headerFooterImages[self::IMAGE_FOOTER_CENTER])) 	$images[self::IMAGE_FOOTER_CENTER] = 	$this->_headerFooterImages[self::IMAGE_FOOTER_CENTER];
    	if (isset($this->_headerFooterImages[self::IMAGE_FOOTER_RIGHT])) 	$images[self::IMAGE_FOOTER_RIGHT] = 	$this->_headerFooterImages[self::IMAGE_FOOTER_RIGHT];
    	$this->_headerFooterImages = $images;

    	return $this->_headerFooterImages;
    }
771537
protected function getMessages()
    {
        $messages = [];
        $path     = $this->sourcePath;

        if ( ! $this->file->exists($path)) {
            throw new \Exception("${path} doesn't exists!");
        }

        foreach ($this->file->allFiles($path) as $file) {
            $pathName = $file->getRelativePathName();

            if ($this->file->extension($pathName) !== 'php') {
                continue;
            }

            if ($this->isMessagesExcluded($pathName)) {
                continue;
            }

            $key = substr($pathName, 0, -4);
            $key = str_replace('\\', '.', $key);
            $key = str_replace('/', '.', $key);

            $messages[$key] = include $path . DIRECTORY_SEPARATOR . $pathName;
        }

        foreach ($this->file->allFiles(resource_path('lang')) as $file) {
            $pathName = $file->getRelativePathName();

            if ($this->file->extension($pathName) !== 'json') {
                continue;
            }
            $key                     = substr($pathName, 0, -4);
            $key                     = str_replace('\\', '.', $key);
            $key                     = str_replace('/', '.', $key);
            $messages[$key . 'json'] = json_decode(file_get_contents($file->getRealPath()));
        }

        return $messages;
    }
1220879
public function getData()
    {
        $res = [
            'recipient' =>  [
                'id' => $this->recipient
            ],
            'notification_type'=> $this->notification_type,
            'messaging_type' => $this->messaging_type
        ];

        $attachment = new Attachment(Attachment::TYPE_AUDIO, [], $this->quick_replies);

        if (strcmp(intval($this->text), $this->text) === 0) {
            $attachment->setPayload(array('attachment_id' => $this->text));
        } elseif (strpos($this->text, 'http://') === 0 || strpos($this->text, 'https://') === 0) {
            $attachment->setPayload(array('url' => $this->text));
        } else {
            $attachment->setFileData($this->getCurlValue($this->text, mime_content_type($this->text), basename($this->text)));
        }

        $res['message'] = $attachment->getData();

        return $res;
    }
1332721
public function getAttachments()
    {
        if ($this->isUserMessage() && isset($this->message->attachments)) {
            return $this->message->attachments;
        }

        return null;
    }
1124835
public function getMessages()
    {
        $message = new IncomingMessage(Video::PATTERN, $this->event->get('ToUserName'),
            $this->event->get('FromUserName'), $this->event);
        $message->setVideos($this->getVideo());

        return [$message];
    }
351314
public function getImages()
    {
        // Sort array
        $images = array();
        if (isset($this->headerFooterImages[self::IMAGE_HEADER_LEFT])) {
            $images[self::IMAGE_HEADER_LEFT] =         $this->headerFooterImages[self::IMAGE_HEADER_LEFT];
        }
        if (isset($this->headerFooterImages[self::IMAGE_HEADER_CENTER])) {
            $images[self::IMAGE_HEADER_CENTER] =     $this->headerFooterImages[self::IMAGE_HEADER_CENTER];
        }
        if (isset($this->headerFooterImages[self::IMAGE_HEADER_RIGHT])) {
            $images[self::IMAGE_HEADER_RIGHT] =     $this->headerFooterImages[self::IMAGE_HEADER_RIGHT];
        }
        if (isset($this->headerFooterImages[self::IMAGE_FOOTER_LEFT])) {
            $images[self::IMAGE_FOOTER_LEFT] =         $this->headerFooterImages[self::IMAGE_FOOTER_LEFT];
        }
        if (isset($this->headerFooterImages[self::IMAGE_FOOTER_CENTER])) {
            $images[self::IMAGE_FOOTER_CENTER] =     $this->headerFooterImages[self::IMAGE_FOOTER_CENTER];
        }
        if (isset($this->headerFooterImages[self::IMAGE_FOOTER_RIGHT])) {
            $images[self::IMAGE_FOOTER_RIGHT] =     $this->headerFooterImages[self::IMAGE_FOOTER_RIGHT];
        }
        $this->headerFooterImages = $images;

        return $this->headerFooterImages;
    }
537107
public function enaImageFiles()
    {
        $properties = $this->getProperties();
        $extString  = (!empty($properties['acceptedFiles'])) ? $properties['acceptedFiles'] : '';
        $imagExts   = $this->getImageExtensionConstant();
        foreach ($imagExts as $imagExt) {
            if (in_array($imagExt, $extString) === false) {
                $extString[] = $imagExt;
            }
        }
        $properties                     = $this->getProperties();
        $properties['acceptedFiles']    = $extString;
        $this->setProperties($properties);
        return $this;
    }
1019418
protected function getMessages()
    {
        $messages = [];
        $path = $this->sourcePath;

        if (!$this->file->exists($path)) {
            throw new \Exception("${path} doesn't exists!");
        }

        foreach ($this->file->allFiles($path) as $file) {
            $pathName = $file->getRelativePathName();
            $extension = $this->file->extension($pathName);
            if ($extension != 'php' && $extension != 'json') {
                continue;
            }

            if ($this->isMessagesExcluded($pathName)) {
                continue;
            }

            $key = substr($pathName, 0, -4);
            $key = str_replace('\\', '.', $key);
            $key = str_replace('/', '.', $key);

            if (starts_with($key, 'vendor')) {
                $key = $this->getVendorKey($key);
            }

            $fullPath = $path.DIRECTORY_SEPARATOR.$pathName;
            if ($extension == 'php') {
                $messages[$key] = include $fullPath;
            } else {
                $key = $key.$this->stringsDomain;
                $fileContent = file_get_contents($fullPath);
                $messages[$key] = json_decode($fileContent, true);
            }
        }

        $this->sortMessages($messages);

        return $messages;
    }
185461
public function getImageDetails() {
		//set default return
		$return = ['width' => 0, 'height' => 0, 'size' => 0];
		//set media path
		$sMediaPath = \Yii::$app->imagemanager->mediaPath;
		$sFileExtension = pathinfo($this->fileName, PATHINFO_EXTENSION);
		//get image file path
		$sImageFilePath = $sMediaPath . '/' . $this->id . '_' . $this->fileHash . '.' . $sFileExtension;
		//check file exists
		if (file_exists($sImageFilePath)) {
			$aImageDimension = getimagesize($sImageFilePath);
			$return['width'] = isset($aImageDimension[0]) ? $aImageDimension[0] : 0;
			$return['height'] = isset($aImageDimension[1]) ? $aImageDimension[1] : 0;
			$return['size'] = Yii::$app->formatter->asShortSize(filesize($sImageFilePath), 2);
		}
		return $return;
	}
994263
public function getImages() : array
	{
		$list = array_merge( [
			'origin' => $this->getOriginImage(),
		], $this->getCropImages() );
		foreach( $list as $key => $image ){
			$image['path'] = str_replace( ROOT_PATH, '', $image['path'] );
			$list[$key]    = $image;
		}
		return $list;
	}