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

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Confirmed Confirmed
        42d 5h 38m 1 Andrzej Longosz 05/Nov/18 2:11 PM
        Confirmed Confirmed Backlog Backlog
        2h 7m 1 Sylvain Guittard 05/Nov/18 4:19 PM
        Backlog Backlog InputQ InputQ
        15m 56s 1 Sylvain Guittard 05/Nov/18 4:35 PM

          People

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

            Dates

            • Created:
              Updated: