Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-29661

Performance of ez_image_alias twig function

    Details

    • Sprint:
      Candidates for next sprint

      Description

      Since 6.13.4 and this pull request (https://github.com/ezsystems/ezpublish-kernel/pull/2325) I determined some problems with ez_image_alias:

      In case that only the uri of an image alias is used in a template but not the height or width or any other variation information the twig function ez_image_alias can be very unperformant as it loads the corresponding binary file (ImagineAwareAliasGenerator.php(85)).
      Imagine there is a slider or gallery which uses srcset/sizes attributes: This leads to many calls of ez_image_alias and can result in an error (PHP Fatal error: Uncaught ImagickException: cache resources exhausted).

      Apart from implementing a custom twig function which only returns the uri of a variation the much consistent solution - in my opinion - would be to call ez_image_alias with a parameter. This parameter could take one or a list of particular variation properties like "uri", "fileName", "imageId" or "mimeType". In class ImagineAwareAliasGenerator it could be checked if it is necessary to load the variation file for returning the wanted properties or if it isn't necessary.

        Activity

        Holger Marx created issue -
        Sylvain Guittard made changes -
        Field Original Value New Value
        Project Community Platforms [ 10801 ] eZ Publish / Platform [ 10401 ]
        Key COM-20059 EZP-29661
        Workflow Community Workflow [ 134955 ] EZEE Development Workflow [ 134964 ]
        Component/s Platform > Repository & Services (Public API impl) [ 10309 ]
        Component/s other/misc [ 10716 ]
        Andrzej Longosz made changes -
        Status Open [ 1 ] Confirmed [ 10037 ]
        Sylvain Guittard made changes -
        Issue Type Improvement [ 4 ] Bug [ 1 ]
        Sylvain Guittard made changes -
        Sprint [2.4] - Sprint 4 [ 118 ]
        Sylvain Guittard made changes -
        Status Confirmed [ 10037 ] Backlog [ 10000 ]
        Sylvain Guittard made changes -
        Status Backlog [ 10000 ] InputQ [ 10001 ]
        Sylvain Guittard made changes -
        Sprint [2.4] - Sprint 4 [ 118 ] Candidates for next sprint [ 109 ]
        Sylvain Guittard made changes -
        Rank Ranked lower

          People

          • Assignee:
            Unassigned
            Reporter:
            Holger Marx
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: