Skip to content

improved image sizes for left/right/center alignment #1289

@mukeshpanchal27

Description

@mukeshpanchal27

Overview

Follow-up: #1187
This issue cover calculate sizes for left/right/center alignment.

Approach

For initial work:

  • Only return a smaller image size if the content or wide size is larger than the image size.
    • If content size is 620px and content use thumbnail the the size will use thumbnail 150px image size instead of 620px.
  • Parse the width value for "px"; for other types( vw, min() ), return the image width according to the default WordPress behaviour.

Core editor issues:

  • The image markup is missing default width and height attributes. These attributes are set when the image is resized.
  • The Cover block does not add the image width attribute.
    • When adding a new Cover block, it defaults to using the full image size.
    • When adding an Image block, selecting a thumbnail, and transforming it to a Cover block, the thumbnail image is used instead of the full image. There should be an image size attribute in the Cover block to display this information.

Metadata

Metadata

Labels

[Plugin] Enhanced Responsive ImagesIssues for the Enhanced Responsive Images plugin (formerly Auto Sizes)[Type] EnhancementA suggestion for improvement of an existing feature

Type

No type

Projects

Status

Done 😃

Relationships

None yet

Development

No branches or pull requests

Issue actions