magento2
magento2 copied to clipboard
Minicart thumbnail image showing wrong size in frontend which is half of image size in XML file
After upgrading Magento version from 2.3.5-p1 to 2.4.3-p1, I am facing the problem of minicart thumbnail size. I found that in the view.xml file, the width and height of half the size set for the minicart thumbnail shows in the frontend minicart.
Note: It works fine in my old Magento version that the size which is in view.xml file shows the width and height of the size in the frontend.
Preconditions (*)
- Magento version 2.4.3-p1
Steps to reproduce (*)
Important: By the way, this is the default issue in both Blank and Luma themes.
- Create any one product and upload the thumbnail image of the product in it.
- Go to Front End and add product to cart.
- You will see thumbnail images of the product in the minicart.
- If you inspect it, the image loads the same size as it would in view.xml but in the upper HTML tag takes half width and height attribute and due to that minicart design is breaking and showing small thumbnail image.
- For example, if you enter the 150x150 width and height in the view.xml file, then it will show 75x75 px inline width and height attributes in the upper HTML tag.
<image id="mini*cart_product*thumbnail" type="thumbnail"> <width>75</width> <height>75</height> </image>
Expected result (*)
- Prodcut item width and height of the tag should be 150px shown which is given in the view.xml file
Actual result (*)
- It is showing 75x75 px width & height in tag. See above screenshots
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- < > Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- < > Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- < > Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- < > Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- < > Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Hi @csvikram44. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:
- Summary of the issue
- Information on your environment
- Steps to reproduce
- Expected and actual results
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, review the Magento Contributor Assistant documentation.
Add a comment to assign the issue: @magento I am working on this
To learn more about issue processing workflow, refer to the Code Contributions.
- Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
@magento give me a 2.4-develop instance.
Hi @csvikram44. Thank you for your request. I'm working on Magento instance for you.
Hi @csvikram44, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.
@magento When will I get the update from your side?
@magento give me a 2.4-develop instance.
Hi @csvikram44. Thank you for your request. I'm working on Magento instance for you.
Hi @csvikram44, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.
Hi @engcom-Delta. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
-
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
Details
If the issue has a valid description, the labelIssue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until labelIssue: Format is valid
appears. -
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add
Issue: Clear Description
label to the issue by yourself. -
[ ] 3. Add
Component: XXXXX
label(s) to the ticket, indicating the components it may be related to. -
[ ] 4. Verify that the issue is reproducible on
2.4-develop
branchDetails
- Add the comment@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-develop
branch, please, add the labelReproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here! -
[ ] 5. Add label
Issue: Confirmed
once verification is complete. -
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hi @csvikram44, That was a fix for the issue https://github.com/magento/magento2/issues/24735, so I believe everything is right there.
@ihor-sviziev My problem is not with the blurry image. In MiniCart, a thumbnail image of half the size of the image entered in the XML file appears in the MiniCart.
File path:
app/design/frontend/{Vendor}/{theme-name}/etc/view.xml
<image id="mini_cart_product_thumbnail" type="thumbnail"> <width>75</width> <height>75</height> </image>
See below screenshot, I added 75px width & height for mini_cart_product_thumbnail in the view.xml file but it shows 37.5px width and due to that it looks small. Instead of showing 37.5px, It should be the 75px width that is entered in the view.xml file.
@csvikram44 right, you should put here 2x size of the image = 150
@ihor-sviziev But why do I need to load a double-size thumbnail image? If I add 10 items to the mini cart then the page load will increase because it loads twice the size of images which is not correct. Also, it was running fine in the old version.
Is there any other reason behind doubling the image size? Note: A developer will enter the size in view.xml that he wants to display on the frontend and not double that.
@ihor-sviziev I hope you understand my point properly. In my view, this is an issue and because of this, all developers will have to face this problem whenever they upgrade from the lower to the latest Magento version.
@csvikram44 the reason for that - retina/4k displays that becoming more and more popular everywhere both in mobile and on computers now. The 1x images looks blurry on these displays, so you have to provide 2x sized images.
@ihor-sviziev Thanks for the update.
I checked by uploading different images, and none of the images are getting blurred. But there are a lot of chances of loading issues increasing in speed on mobile when multiple product items are added. Please think about it one more time and update me.
Hi @csvikram44 , Thank you for reply and we tried to reproduce the issue on Magento 2.4 Develop and found that issue is reproducible. Product item width and height of the tag is not same on Minicart when compared to view.xml.
View.xml

in Mini cart & Shipping page:
Hence , issue has been confirmed.
:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-2808 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Delta. Thank you for verifying the issue.
Issue Available: @engcom-Delta, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
@magento I am working on this
Hi @olegpola! :wave:
Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team
command to join Contributors team.
@magento add to contributors team
Hi @olegpola! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.
@magento I am working on this
Hi @csvikram44
This issue is invalid.
In the changes in PR 24743 in order to fix issue #24735, @dmdanilchenko changed the width
(and height
) in both HTML and XML files:
app/code/Magento/Catalog/view/frontend/web/template/product/image_with_borders.html
app/design/frontend/Magento/blank/etc/view.xml
app/design/frontend/Magento/luma/etc/view.xml
You can take a look at PR's changed files here: https://github.com/magento/magento2/pull/24743/files
You guys had this issue because you declared width and height for<image id="mini_cart_product_thumbnail" type="thumbnail">
in
Conclusion: The correct solution is double the size of height and width for <image id="mini_cart_product_thumbnail" type="thumbnail">
in
Can somebody comment on the status of this issue? Some say this is a valid issue and others say it is not. Imho the need to double the size in view.xml just to get back to how things were before seems a somewhat strange solution to the issue description.
@Rickertje This issue should be closed. The need to double the size in view.xml is for fixing issue #24735. If you are still confused, please read my comment above (I've just updated it to say the change in order to fix #24735). @engcom-Delta could you check my comment and mark this issue as closed?
Hi @csvikram44, I do agree with @Viper9x, the image should be 2x sized. I'm closing this issue as not relevant.
Hi @ihor-sviziev. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:
-
- Add/Edit
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.
- Add/Edit
-
- Verify that the issue is reproducible on
2.4-develop
branchDetails
- Add the comment@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-develop
branch, please, add the labelReproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
- Verify that the issue is reproducible on
-
- If the issue is not relevant or is not reproducible any more, feel free to close it.
- Join Magento Community Engineering Slack and ask your questions in #github channel.