magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Minicart thumbnail image showing wrong size in frontend which is half of image size in XML file

Open csvikram44 opened this issue 2 years ago • 25 comments

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 (*)

  1. Magento version 2.4.3-p1

Steps to reproduce (*)

Important: By the way, this is the default issue in both Blank and Luma themes.

  1. Create any one product and upload the thumbnail image of the product in it.
  2. Go to Front End and add product to cart.
  3. You will see thumbnail images of the product in the minicart.
  4. 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.
  5. 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 (*)

  1. Prodcut item width and height of the tag should be 150px shown which is given in the view.xml file

Actual result (*)

  1. 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”.

csvikram44 avatar Apr 07 '22 06:04 csvikram44

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.


: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

m2-assistant[bot] avatar Apr 07 '22 06:04 m2-assistant[bot]

@magento give me a 2.4-develop instance.

csvikram44 avatar Apr 07 '22 08:04 csvikram44

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?

csvikram44 avatar Apr 07 '22 08:04 csvikram44

@magento give me a 2.4-develop instance.

csvikram44 avatar Apr 07 '22 08:04 csvikram44

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).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: 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 branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced 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.

m2-assistant[bot] avatar Apr 07 '22 12:04 m2-assistant[bot]

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 avatar Apr 07 '22 13:04 ihor-sviziev

@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.

image

csvikram44 avatar Apr 07 '22 13:04 csvikram44

@csvikram44 right, you should put here 2x size of the image = 150

ihor-sviziev avatar Apr 07 '22 13:04 ihor-sviziev

@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.

csvikram44 avatar Apr 07 '22 14:04 csvikram44

@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 avatar Apr 07 '22 14:04 csvikram44

@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 avatar Apr 07 '22 14:04 ihor-sviziev

@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.

csvikram44 avatar Apr 07 '22 16:04 csvikram44

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

Screenshot 2022-04-08 at 10 26 24 PM

in Mini cart & Shipping page: Screenshot 2022-04-08 at 10 22 44 PM Screenshot 2022-04-08 at 10 22 44 PM

Hence , issue has been confirmed.

engcom-Delta avatar Apr 08 '22 17:04 engcom-Delta

:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-2808 is successfully created for this GitHub issue.

github-jira-sync-bot avatar Apr 08 '22 17:04 github-jira-sync-bot

: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.

m2-assistant[bot] avatar Apr 08 '22 17:04 m2-assistant[bot]

@magento I am working on this

olegpola avatar May 06 '22 11:05 olegpola

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.

m2-assistant[bot] avatar May 06 '22 11:05 m2-assistant[bot]

@magento add to contributors team

olegpola avatar May 06 '22 12:05 olegpola

Hi @olegpola! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.

m2-assistant[bot] avatar May 06 '22 12:05 m2-assistant[bot]

@magento I am working on this

olegpola avatar May 07 '22 09:05 olegpola

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 /etc/view.xml. But with the new change in PR 24743, the width and height size should be double in /etc/view.xml.

Conclusion: The correct solution is double the size of height and width for <image id="mini_cart_product_thumbnail" type="thumbnail"> in /etc/view.xml, not changing any from app/code/Magento/Catalog/view/frontend/web/template/product/image_with_borders.html.

TuVanDev avatar Sep 20 '22 11:09 TuVanDev

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 avatar Mar 08 '23 13:03 Rickertje

@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?

TuVanDev avatar Mar 08 '23 13:03 TuVanDev

Hi @csvikram44, I do agree with @Viper9x, the image should be 2x sized. I'm closing this issue as not relevant.

ihor-sviziev avatar Mar 10 '23 10:03 ihor-sviziev

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:

    1. Add/Edit Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced 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!
    1. If the issue is not relevant or is not reproducible any more, feel free to close it.

m2-assistant[bot] avatar Mar 10 '23 10:03 m2-assistant[bot]