Uploaded image for project: 'Ibexa IBX'
  1. Ibexa IBX
  2. IBX-8249

Getting a variation of an image with the .avif extension doesn't work

    XMLWordPrintable

Details

    • Ibexa Open Source
    • Yes

    Description

      Steps to reproduce:

      1. Add Image content with an image of the .avif type extension.
      2. Add the following SA configuration:
                    content_view:
                        full:
                            article:
                                template: '@ezdesign/full/image.html.twig'
                                match:
                                    Identifier\ContentType: image
        
      3. Create a new .twig file with the following path: templates/themes/standard/full/image.html.twig
        and with the following content:
        {{ ez_render_field(content, 'image', {
            'template': 'fields/image.html.twig'
        }) }}
        
      4. Create another .twig file with the following path: templates/fields/image.html.twig
        and with the following content:
        {% block ezimage_field %}
            {% set imageAlias = ez_image_alias( field, versionInfo, 'small' ) %}
            {% set src = imageAlias ? asset( imageAlias.uri ) : "//:0" %}
        
            <div style="background: url({{ src }});
                    width: 100vh; height: 20vh"></div>
        {% endblock %}
        
      5. Open the image content from step 1. on frontend.

      Result:
      One is presented with an exception:

      An exception has been thrown during the rendering of a template ("An image could not be created from the given input") in "fields/image.html.twig".

      Expected result:
      The image should be rendered properly, just like it's done for other images with different than .avif extensions.

      Designs

        Attachments

          Activity

            People

              Unassigned Unassigned
              bartlomiej.wajda@ibexa.co Bartłomiej Wajda
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: