Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images wider than editor are shrunk horizontally #14542

Closed
Tracked by #14146
mmotyczynska opened this issue Jul 7, 2023 · 1 comment
Closed
Tracked by #14146

Images wider than editor are shrunk horizontally #14542

mmotyczynska opened this issue Jul 7, 2023 · 1 comment
Assignees
Labels
package:image squad:core Issue to be handled by the Core team. type:task This issue reports a chore (non-production change) and other types of "todos".

Comments

@mmotyczynska
Copy link
Contributor

Provide a description of the task

After introducing the width and height attributes for images, if an image is added that is wider than the width of the editor, it will be shrunk horizontally. This is due to the max-width: 100% for images, while the height is taken from the new height attribute. As a result, the image is only as wide as the editor, but the height remains unchanged.

The task is to force the images to have a good appearance in the above cases.

image

@mmotyczynska mmotyczynska added type:task This issue reports a chore (non-production change) and other types of "todos". package:image squad:core Issue to be handled by the Core team. labels Jul 7, 2023
@mmotyczynska mmotyczynska self-assigned this Jul 7, 2023
@CKEditorBot CKEditorBot added the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Jul 7, 2023
@CKEditorBot CKEditorBot added status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. and removed status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. labels Jul 7, 2023
@mmotyczynska
Copy link
Contributor Author

Problems to be solved:

  • [Problem 1] Images (inline) wider than editor and with height set are shrunk (in editing)
  • [Problem 2] Images (block) wider than editor and with height set are shrunk (in editing)
  • [Problem 3] Images (block) wider than parent container and with height set are shrunk (in data)

Solution for [Problem 1]:

  • [editing] height: auto (for all inline) -> fixes the [Problem 1], but creates:
  • [Problem 4] Images (inline) with broken aspect ratio are displayed incorrectly, because height: auto overrides the height of the image (in editing)

Solution for [Problem 2]:

  • [editing] height: auto (for all block) -> fixes the [Problem 2], but creates:
  • [Problem 5] Images (block) with broken aspect ratio are displayed incorrectly, because height: auto overrides the height of the image (in editing)

Solution for [Problem 3]:

  • height: auto (for block also for data) -> fixes [Problem 3], but there is one more:
  • [Problem 6] Images (block) with broken aspect ratio are displayed incorrectly, because height: auto overrides the height of the image (in data)

Solution for [Problem 4]:

  • [editing] set aspect-ratio (for inline) -> fixes [Problem 4]

Solution for [Problem 5]:

  • [editing] set aspect-ratio (for block) -> fixes [Problem 5]

Solution for [Problem 6]:

  • [data] set aspect-ratio (for block) -> fixes [Problem 6]

[Problem 7]: Inline images with broken aspect ratio and resized are not displayed correctly (data).

Solution for [Problem 7]:

  • [data] set aspect-ratio (for inline) but only if it’s resized -> fixes [Problem 7]

Summary - we should add:

  • height: auto for:
    • Editing inline
    • Data inline (resized only)
    • Editing block
    • Data block
  • aspect-ratio for:
    • Editing inline
    • Data inline (resized only)
    • Editing block
    • Data block

mmotyczynska added a commit that referenced this issue Jul 11, 2023
…itor-are-shrunk-horizontally

Task (image): Images that are wider than the editor should be displayed in the correct proportions. Closes #14542.
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Jul 11, 2023
@CKEditorBot CKEditorBot added this to the upcoming milestone Jul 11, 2023
@CKEditorBot CKEditorBot modified the milestones: upcoming, iteration 67 Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:image squad:core Issue to be handled by the Core team. type:task This issue reports a chore (non-production change) and other types of "todos".
Projects
None yet
Development

No branches or pull requests

2 participants