Issue Bug Closed

#85392Fluid ImageViewHelper cannot render ProcessedFile

Leonie Philine 06/26/18, 19:14 updated 09/27/18, 09:08

Description

You cannot render a ProcessedFile via <f:image></f:image>

It neither works via:

<f:image image="{processedFile}" />

nor via

<f:image src="{processedFile.publicUrl}" />

Only viable workaround is:
<f:image src="{processedFile.publicUrl}"></f:image>

- Why would I want to do that at all, when ImageViewHelper creates ProcessedFiles itself?

—> Because I want to render a video list – using the online media helpers to create a video preview image, which should then be rendered as plain image:

    /** (Video domain model)
     * @return null|ProcessedFile
     */
    public function getPreviewImage(): ?ProcessedFile
    {
        if (!$this->videoFile
            || !$this->videoFile->getOriginalResource()
            || !$this->videoFile->getOriginalResource()->getOriginalFile()
        ) {
            return null;
        }

        $previewImageFile = $this->videoFile->getOriginalResource()->getOriginalFile()->process(
            ProcessedFile::CONTEXT_IMAGEPREVIEW,
            [
                'width' => 576,
                'height' => 324,
            ]
        );

        return $previewImageFile;
    }

`video` is a Video domain model.
`video.previewImage` is created via the getter above.
`video.videoFile` is a fileReference to a Vimeo online resource.

<f:for each="{container.videos}" as="video">
    <li class="video-list__video-item">
        <img src="{video.previewImage.publicUrl}" alt="{video.videoFile.title}" title="{video.videoFile.title}" />
        <span class="video-list__video-item__title">{video.videoFile.title}</span>
     </li>
</f:for>

It should be possible to use <f:image></f:image> with {video.previewImage} as its input – that way, further processing (crop scale mask) would be possible.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.