Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-68536

Allow Alloy Editor to set one dimension when resizing an image

Details

    • Feature Request
    • Status: Under Review
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Alloy Editor
    • None

    Description

      User Story:

      As a developer, integrating Alloy Editor, I'd like a configuration option, to allow me to set image dimensions with width|height|both.

      This would allow me better control, in how image scaling behaves in the resulting output. Without resorting to !important overrides.

      Background:

      See discussion: https://in.liferay.com/web/support/forums/-/message_boards/message/25343702

      When resizing an image's height or width or both, height and width dimensions are set as inline styles on the image element.

      When the resulting output image is displayed in a container smaller than the set static width, the image breaks out of the container.

      This is typically fixed by setting max-width: 100% on the image, forcing it to resize.

      An issue arises, that because height is set, the original ratio is not kept, causing the image to squish.

      To further fix this, height must to set to auto, to allow the original ratio to remain intact. But because height as be set as an inline style, !important must be used to override the inline height.

      Attachments

        Issue Links

          Activity

            People

              marco.leo Marco Leo
              john.zhao John Zhao (Inactive)
              Votes:
              3 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:

                Packages

                  Version Package