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

imageAlias.width and imageAlias.height fields not filled in

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: High High
    • Resolution: Fixed
    • Affects Version/s: 5.4.10, 1.7.5, 1.11.0
    • Fix Version/s: Customer request, 1.7.8, 1.13.4
    • Component/s: None
    • Labels:
      None
    • Sprint:
      [2.2] Sprint 6

      Description

      Tested on 2014.11

      The image variation is available, and its uri is correct.

      Any tip?

      Steps to reproduce:

      1. Create the new article with an image in the RichText field
      2. Display an article on front-end
      3. Open developer tools in your browser. Find the <img... element in article content.

      Result:
      You should notice that element doesn't have attributes width and height.

      Expected result:
      img element should have width and height attributes with correct values (depending on used variation).

        Activity

        Hide
        Bertrand Dunogier added a comment - - edited

        No "tips" in particular. You could aim to Slack for tips. JIRA issues require handling and time, and I expect them to be more specific.

        This is however a known issue. It's not really on purpose, but that's how it is now. Imagine doesn't make those available to us. Is it a problem, or not really ?

        In any case, we have not planned to prioritize this anytime soon based on the information we have.

        Show
        Bertrand Dunogier added a comment - - edited No "tips" in particular. You could aim to Slack for tips. JIRA issues require handling and time, and I expect them to be more specific. This is however a known issue. It's not really on purpose, but that's how it is now. Imagine doesn't make those available to us. Is it a problem, or not really ? In any case, we have not planned to prioritize this anytime soon based on the information we have.
        Hide
        Gaetano Giunta added a comment -

        I the Imagine lib does not provide those fields by default, then I am fine with it, no need to go to great lengths to work around it.

        However I am under the impression that the std twig template which renders images always outputs the alt and width attributes in html even if they are not explicitly set by the developer. I think that in that case, the attributes should not be produced.

        I will check the source code and try to come up with a PR

        Show
        Gaetano Giunta added a comment - I the Imagine lib does not provide those fields by default, then I am fine with it, no need to go to great lengths to work around it. However I am under the impression that the std twig template which renders images always outputs the alt and width attributes in html even if they are not explicitly set by the developer. I think that in that case, the attributes should not be produced. I will check the source code and try to come up with a PR
        Hide
        Bertrand Dunogier added a comment - - edited

        However I am under the impression that the std twig template which renders images always outputs the alt and width attributes in html even if they are not explicitly set by the developer. I think that in that case, the attributes should not be produced.

        You're right !

        I will check the source code and try to come up with a PR

        It would be great, thank you for considering it.

        Show
        Bertrand Dunogier added a comment - - edited However I am under the impression that the std twig template which renders images always outputs the alt and width attributes in html even if they are not explicitly set by the developer. I think that in that case, the attributes should not be produced. You're right ! I will check the source code and try to come up with a PR It would be great, thank you for considering it.
        Hide
        Philipp Bohnenstengel added a comment -

        have there been any findings on this? getting width and height and height values from imageAlias objects would be very helpful for implementing features like amp-img tags https://www.ampproject.org/docs/reference/components/amp-img (for fixed aspect-ratio variations width and height can be hardcoded but for other image variations I did not find a workaround yet).

        Show
        Philipp Bohnenstengel added a comment - have there been any findings on this? getting width and height and height values from imageAlias objects would be very helpful for implementing features like amp-img tags https://www.ampproject.org/docs/reference/components/amp-img (for fixed aspect-ratio variations width and height can be hardcoded but for other image variations I did not find a workaround yet).
        Hide
        André Rømcke added a comment - - edited

        Bertrand Dunogier It seems Imagine has size available, so just to clarify scope of what is needed to able to fix this: Is this perhaps caused by sizes not being available on BinaryFile objects coming from IO (Cluster) service or something down that line?

        Show
        André Rømcke added a comment - - edited Bertrand Dunogier It seems Imagine has size available , so just to clarify scope of what is needed to able to fix this: Is this perhaps caused by sizes not being available on BinaryFile objects coming from IO (Cluster) service or something down that line?
        Hide
        Michał Szołtysek added a comment -

        Tested before merge.

        Show
        Michał Szołtysek added a comment - Tested before merge.

          People

          • Assignee:
            Unassigned
            Reporter:
            Gaetano Giunta
          • Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Agile