Skip to content

[Issue] Bugfix/wrong size attributes in image with border #30186

Closed
@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #30139: Bugfix/wrong size attributes in image with border


Summary (*)

Magento 2.4-develop
This PR removes most changes from commit #4e085c7

Commit #4e085c7 tried to fix images getting distorted.
By setting a boolean for the image_with_border.phtml.
This boolean would set the width and height attribute, to the invalid html max-width and max-height attribute.
While this did fix the images not getting distorted.
This did reintroduced the use of invalid html attributes.

This commit unsets the boolean, use of invalid html attributes and fixes the images getting distorted, via the CSS instead.

Examples (*)

Proposed solution

  1. Remove the boolean enable_lazy_loading_for_images_without_borders
  2. Remove the max-width and max-height and the if statement holding this.
  3. Add the value width: auto to the .product-image-photo (This also possible via object-fit: scale-down)

This PR also removes the redundant max-width and height from the .product-image-photo.
Since these values are already set globally, on the image, via the reset styles.

Metadata

Metadata

Assignees

Labels

Component: CatalogFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P3May be fixed according to the position in the backlog.Progress: doneReported on 2.4.0Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions