Returns TRUE if content is an Image Asset.

@param \eZ\Publish\API\Repository\Values\Content\Content $content

@return bool

@throws \eZ\Publish\API\Repository\Exceptions\NotFoundException
334642
public function isAsset(Content $content): bool
    {
        if ($this->contentTypeId === null) {
            $contentType = $this->contentTypeService->loadContentTypeByIdentifier(
                $this->mappings['content_type_identifier']
            );

            $this->contentTypeId = $contentType->id;
        }

        return $content->contentInfo->contentTypeId === $this->contentTypeId;
    }
1182439
protected function hasInstructions($content)
    {
        $instructionKeys = $this->getInstructions();
        foreach ($instructionKeys as $instructionKey) {
            if (str_contains($content, ['[[' . $instructionKey . ']]', '[[/' . $instructionKey . ']]'])) {
                return true;
            }
        }
        return false;
    }
111005
static function FindContentRights(Content $content)
    {
        $result = null;
        $currContent = $content;
        do
        {
            $result = $currContent->GetUserGroupRights();
            $currContent = ContentTreeUtil::ParentOf($currContent);
        } 
        while (!$result && $currContent);
        if ($result)
        {
            return $result;
        }
        return self::GetUpperContentRights($content);
    }
363758
public function writeCachedContent($content)
    {
        return $this->smarty->ext->_updateCache->writeCachedContent($this->cached, $this, $content);
    }
1188278
public function asset($encPath, $contentType, Filesystem $fileSystem)
    {
        try {
            $path = CryptoServiceFacade::url_decode($encPath);

            if (Request::get('isModule') === 'true') {
                $filePath = $path;
            } else {
                if (str_contains($path, 'dist/') || str_contains($path, 'themes/')) {
                    $filePath = __DIR__.'/../Assets/'.$path;
                } else {
                    $filePath = __DIR__.'/../Assets/src/'.$path;
                }
            }

            $fileName = basename($filePath);

            if (!is_null($contentType)) {
                $contentType = CryptoServiceFacade::url_decode($contentType);
            } else {
                $contentType = $fileSystem->mimeType($fileName);
            }

            $headers = ['Content-Type' => $contentType];

            return response()->download($filePath, $fileName, $headers);
        } catch (Exception $e) {
            return Response::make('file not found');
        }
    }
347048
public function includeChildren(Content $content)
    {
        if ($content->isChildrenLoaded()) {
            return $this->collection($content->children, new ContentTransformer()); // We don't want LAZY LOADING !
        }
        return null;
    }
86354
public function content($content)
    {
        if ($content instanceof Renderable) {
            $this->content = $content->render();
        } else {
            $this->content = (string) $content;
        }

        return $this;
    }
1329405
public function isImage(): bool
    {
        return is_resource($this->content) && in_array($this->contentType, [
            self::CONTENT_TYPE_IMAGE_JPEG, self::CONTENT_TYPE_IMAGE_PNG, self::CONTENT_TYPE_IMAGE_GIF,
        ]);
    }
1269002
private function isAcceptableContentType(ServerRequestInterface $request, string $contentType): bool
    {
        $acceptHeader = $request->getHeaderLine('Accept');

        if (strpos($acceptHeader, $contentType) !== false) {
            return true;
        }
        // special case for 'xxx+json' and 'xxx+xml' example : 'application/xhtml+xml'
        if (preg_match('/\+(json|xml)/', $acceptHeader, $matches)) {
            $mediaType = 'application/' . $matches[1];
            if ($mediaType === $contentType) {
                return true;
            }
        }
        // special case when accepting all subtypes of the mime 'mime/*'
        if (strpos($acceptHeader, strtok($contentType, '/') . '/*') !== false) {
            return true;
        }
        // special case when accepting all mimes '*/*'
        if (strpos($acceptHeader, '*/*') !== false) {
            return true;
        }

        return false;
    }
1014611
public function contains($content, $name)
    {
        if ($this->exists($name)) {
            preg_match_all('/'.$this->getRegex().'/s', $content, $matches, PREG_SET_ORDER);

            if (empty($matches)) {
                return false;
            }

            foreach ($matches as $shortcode) {
                if ($name === $shortcode[2]) {
                    return true;
                }
            }
        }

        return false;
    }
969623
public static function detectByContent($content)
	{
		if (!class_exists('Finfo'))
		{
			return;
		}

		$finfo = new Finfo(FILEINFO_MIME_TYPE);
		$mimeType = $finfo->buffer($content);

		return $mimeType ?: null;
	}
609826
public function getFirstImage($content)
    {
        Deprecated::method('3.4');

        $contentType = $content->getContenttype();
        if (!$contentType instanceof ContentType) {
            return null;
        }
        $fields = $contentType->getFields();
        if (!is_array($fields)) {
            return null;
        }

        // Grab the first field of type 'image', and return that.
        foreach ($fields as $key => $field) {
            if ($field['type'] === 'image' && is_array($content->get($key))) {
                return $content->get($key);
            }
        }

        // otherwise, no image.
        return null;
    }
473813
public function asset($encPath, $contentType, Filesystem $fileSystem)
    {
        return $this->service->asset($encPath, $contentType, $fileSystem);
    }
665258
public function supports(string $contentType): bool
    {
        foreach (array_keys($this->types) as $pattern) {
            $pattern = str_replace(['*', '.', '/', '+'], ['(.*)', '.', '\/', '\+'], $pattern);
            if (preg_match("#^$pattern$#i", $contentType) > 0) {
                return true;
            }
        }
        return false;
    }
1164304
public function isMainZone($content)
    {
        if ($content instanceof ContentSet) {
            $pages = $this->entityManager->getRepository('BackBee\ClassContent\ContentSet')->findPagesByContent($content);

            if (count($pages) > 0) {
                foreach($pages as $page) {
                    if ($page instanceof Page) {
                        if (false !== $index = $page->getContentSet()->indexOf($content, true)) {
                            $zone = $page->getLayout()->getZone($index);
                            if (is_a($zone, '\stdClass') && 1 === $zone->mainZone) {
                                return $page;
                            }
                        }
                    }
                }
            }
        }

        return null;
    }
1188951
protected function text_content($content) {
        if (!is_null($this->contenttransformer)) { // Apply content transformation
            $content = $this->contenttransformer->process($content);
        }
        return is_null($content) ? null : $this->xml_safe_text_content($content); // Safe UTF-8 and encode
    }
111363
public function isImage()
	{
		$mime = $this->getMimeType();
		
		// The $imageMimes property contains an array of file extensions and
		// their associated MIME types. We will loop through them and look for 
		// the MIME type of the current SymfonyUploadedFile.
		foreach ($this->imageMimes as $imageMime)
		{
			if (in_array($mime, (array) $imageMime))
			{
				return true;
			}
		}

		return false;
	}