Fetch POIs from metadata for the image

@return array Array with POIs
196101
private function getPoisFromMetadata() {
        $metadata = $this->event->getDatabase()->getMetadata(
            $this->image->getUser(),
            $this->image->getImageIdentifier()
        );

        return isset($metadata['poi']) ? $metadata['poi'] : [];
    }
1276966
public function data() : array
    {
        $data = array();

        $data['classes'] = implode(' ', apply_filters('Modularity/Module/Classes', array('box', 'box-index'), $this->post_type, $this->args));

        // Get column classes
        $data['columnClass'] = 'grid-md-6';
        if (!empty(get_field('index_columns', $this->ID))) {
            $data['columnClass'] = get_field('index_columns', $this->ID);
        }

        $data['imageDimension'] = $this->getImageDimension($data['columnClass']);

        // Get the index items
        $data['items'] = $this->prepareItems(get_field('index', $this->ID));

        return $data;
    }
15790
public function toArray()
	{
		return array(
			'type' 			=> self::TYPE_ID,
			'id' 			=> $this->imageId,
			'align' 		=> $this->align,
			'style' 		=> $this->style,

			'alternate_text'	=> $this->alternateText,
			'title' 		=> $this->title,
			'description' 	=> $this->description,

			'size_width' 	=> $this->width,
			'size_height' 	=> $this->height,
			'crop_top' 		=> $this->cropTop,
			'crop_left' 	=> $this->cropLeft,
			'crop_width' 	=> $this->cropWidth,
			'crop_height' 	=> $this->cropHeight,

			'size_name' 	=> $this->sizeName,
		);
	}
1090331
public function getImages()
    {
        $images = array();
        $image = $this->getImage();
        if (!empty($image)) {
            $images[$image] = $image;
        }

        $screenshotsPath = $this->getFilePath().self::SCREENSHOT_PATH;
        $files = array();
        if (is_dir($screenshotsPath)) {
            $files = scandir($screenshotsPath);
        }

        foreach ($files as $file) {
            $ext = pathinfo($file, PATHINFO_EXTENSION);
            if ($ext === 'gif' || $ext === 'jpg' || $ext === 'png') {
                $images['/theme/images/screenshots/'.$file] = '/theme/images/screenshots/'.$file;
            }
        }


        return $images;
    }
423414
private function get_mf2meta() {
		$meta = get_post_meta( $this->uid );
		if ( ! $meta ) {
			return array();
		}
		if ( isset( $meta['response'] ) ) {
			$response = maybe_unserialize( $meta['response'] );
			// Retrieve from the old response array and store in new location.
			if ( ! empty( $response ) ) {
				$new = array();
				// Convert to new format and update.
				if ( ! empty( $response['title'] ) ) {
					$new['name'] = $response['title'];
				}
				if ( ! empty( $response['url'] ) ) {
					$new['url'] = $response['url'];
				}
				if ( ! empty( $response['content'] ) ) {
					$new['content'] = $response['content'];
				}
				if ( ! empty( $response['published'] ) ) {
					$new['published'] = $response['published'];
				}
				if ( ! empty( $response['author'] ) ) {
					$new['card']         = array();
					$new['card']['name'] = $response['author'];
					if ( ! empty( $response['icon'] ) ) {
						$new['card']['photo'] = $response['icon'];
					}
				}
				$new         = array_unique( $new );
				$new['card'] = array_unique( $new['card'] );
				if ( isset( $new ) ) {
					update_post_meta( $this->uid, 'mf2_cite', $new );
					delete_post_meta( $this->uid, 'response' );
					$meta['cite'] = $new;
				}
			}
		}
		foreach ( $meta as $key => $value ) {
			if ( ! self::str_prefix( $key, 'mf2_' ) ) {
				unset( $meta[ $key ] );
			} else {
				unset( $meta[ $key ] );
				$key = str_replace( 'mf2_', '', $key );
				// Do not save microput prefixed instructions
				if ( self::str_prefix( $key, 'mp-' ) ) {
					continue;
				}
				$value = array_map( 'maybe_unserialize', $value );
				if ( 1 === count( $value ) ) {
					$value = array_shift( $value );
				}
				if ( is_string( $value ) ) {
					$meta[ $key ] = array( $value );
				} else {
					$meta[ $key ] = $value;
				}
			}
		}
		return array_filter( $meta );
	}
1068265
public function getSitemapImagesAttribute()
    {
        return $this->images->map(function ($image) {
            return [
                'url' => $image->url,
                'title' => $image->title,
            ];
        })->all();
    }
595010
public static function photos()
    {
        if (!getConfig('sitemap.photos')) {
            return [];
        }

        $table = TableRegistry::get('MeCms.PhotosAlbums');
        $url = Cache::read('sitemap', $table->getCacheName());

        if (!$url) {
            $alias = $table->Photos->getAlias();

            $albums = $table->find('active')
                ->select(['id', 'slug'])
                ->contain($alias, function (Query $q) use ($alias) {
                    return $q->find('active')
                        ->select(['id', 'album_id', 'modified'])
                        ->order([sprintf('%s.modified', $alias) => 'DESC']);
                });

            if ($albums->isEmpty()) {
                return [];
            }

            $latest = $table->Photos->find('active')
                ->select(['modified'])
                ->order([sprintf('%s.modified', $alias) => 'DESC'])
                ->firstOrFail();

            //Adds albums index
            $url[] = self::parse(['_name' => 'albums'], ['lastmod' => $latest->modified]);

            foreach ($albums as $album) {
                //Adds the album
                $url[] = self::parse(['_name' => 'album', $album->slug], ['lastmod' => array_value_first($album->photos)->modified]);

                //Adds each photo
                foreach ($album->photos as $photo) {
                    $url[] = self::parse(
                        ['_name' => 'photo', 'slug' => $album->slug, 'id' => $photo->id],
                        ['lastmod' => $photo->modified]
                    );
                }
            }

            Cache::write('sitemap', $url, $table->getCacheName());
        }

        return $url;
    }
1247062
protected function getImages()
    {
        $table = ORM::getTable($this->getTable()->getPlugin(), 'Image');
        $q = $table->createSelectQuery();
        $q->where(
            $q->expr->lAnd(
                $q->expr->eq('groupId', $q->bindValue($this->id, null, PDO::PARAM_INT)),
                $q->expr->eq('active', $q->bindValue(true, null, PDO::PARAM_BOOL))
            )
        );
        $q->orderBy('position');
        return $table->loadFromQuery($q);
    }
732404
private function getImageData()
    {
        ob_start();
        imagegif($this->image);
        $output = ob_get_contents();
        ob_end_clean();
        imagedestroy($this->image);

        return $output;
    }
1044707
public function getIds(): array {
        $this->loadMetadata();
        $ids = array();
        foreach ($this->metadata->allResources(RC::idProp()) as $i) {
            $ids[] = $i->getUri();
        }
        return $ids;
    }
693199
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Insert Image Tab:
        
        $fields->insertAfter(
            Tab::create(
                'Image',
                $this->fieldLabel('Image')
            ),
            'Main'
        );
        
        // Create Image Fields:
        
        $fields->addFieldsToTab(
            'Root.Image',
            [
                FieldSection::create(
                    'LinkImage',
                    $this->fieldLabel('LinkImage'),
                    [
                        $image = UploadField::create(
                            'LinkImage',
                            $this->fieldLabel('LinkImageFile')
                        ),
                        ViewportsField::create(
                            'LinkImageWidth',
                            $this->fieldLabel('LinkImageWidth')
                        )->setUseTextInput(true),
                        ViewportsField::create(
                            'LinkImageHeight',
                            $this->fieldLabel('LinkImageHeight')
                        )->setUseTextInput(true),
                        CheckboxField::create(
                            'InlineVector',
                            $this->fieldLabel('InlineVector')
                        )
                    ]
                )
            ]
        );
        
        // Define Image Field:
        
        $image->setAllowedExtensions(['gif', 'jpg', 'jpeg', 'png', 'svg']);
        $image->setFolderName($this->getAssetFolder());
        
        // Answer Field Objects:
        
        return $fields;
    }
799729
public function getApis()
    {
        if (empty($this->theApis)) {
            $response = Json::decode(file_get_contents(self::DISCOVERY_URL), false);

            $theApis = [];
            foreach ($response->items as $item) {
                if (!isset($theApis[$item->name])) {
                    $theApis[$item->name] = [];
                }
                $theApis[$item->name][$item->version] = $item;
            }
            ksort($theApis);

            $this->theApis = $theApis;
        }

        return $this->theApis;
    }
274700
public function get_thumbnail()
	{
		if (!isset($this->data['thumbnail']))
		{
			if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail'))
			{
				$this->data['thumbnail'] = $return[0]['attribs'][''];
			}
			else
			{
				$this->data['thumbnail'] = null;
			}
		}
		return $this->data['thumbnail'];
	}
324187
public function getMetaImageWrapperClassNames()
    {
        $classes = [$this->owner->MetaImageCaptionShown ? 'captionImage' : 'image'];
        
        if ($alignment = $this->owner->getMetaImageAlignment()) {
            $classes[] = $alignment;
        }
        
        return $classes;
    }
743782
protected function _fetch() {
		if (!$this->_resource) {
			return false;
		}
		if (!$this->_resource->hasNext()) {
			return null;
		}
		$result = $this->_resource->getNext();

		if ($result instanceof MongoGridFSFile) {
			$result = ['file' => $result] + $result->file;
		}
		return [$this->_iterator, $result];
	}
248877
public function getInfo() : array
    {
        if ($this->processed === true) {
            return [
                'canvas' => [
                    'width' => $this->canvas['width'],
                    'height' => $this->canvas['height'],
                    'color' => $this->canvas['color']
                ],
                'resized-image' => [
                    'width' => $this->intermediate['width'],
                    'height' => $this->intermediate['height']
                ],
                'canvas-placement' => [
                    'x' => $this->canvas['spacing']['x'],
                    'y' => $this->canvas['spacing']['y']
                ],
                'resizer' => [
                    'maintain-aspect-ratio' => $this->intermediate['maintain_aspect'],
                    'quality' => $this->canvas['quality']
                ]
            ];
        } else {
            throw new \Exception(Helper::ERROR_CALL_GETINFO);
        }
    }
301417
protected function _getPicture()
    {
        if (!empty($this->_properties['id'])) {
            $files = ((new Folder(USER_PICTURES))->find($this->_properties['id'] . '\..+'));

            if (!empty($files)) {
                return 'users' . DS . array_values($files)[0];
            }
        }

        //Checks for `webroot/img/no-avatar.jpg`
        if (is_readable(WWW_ROOT . 'img' . DS . 'no-avatar.jpg')) {
            return 'no-avatar.jpg';
        }

        return 'MeCms.no-avatar.jpg';
    }