magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.47k stars 9.28k forks source link

[GraphQl] Watermark images don't show. #31353

Open Hexmage opened 3 years ago

Hexmage commented 3 years ago

Preconditions (*)

Reproduced in

  1. 2.3.5-p2
  2. 2.4.1
  3. 2.4-develop

Steps to reproduce (*)

  1. Configure a watermark for image, small_image and thumbnail
  2. Do a GraphQl product request to get image, small_image and thumbnail.
  3. Go to the image, small_image, thumbnail cache link in the GraphQl request.

Expected result (*)

  1. Image is shown with a watermark.

Actual result (*)

  1. Image placeholder or a 404 is shown.

The issue is caused by Watermarked images not automatically being created. You have to manually run bin/magento catalog/image/resize to generate the watermarked images. If this was the only issue this would have been workable, but slow. But GraphQl requests the image with width = null and height = null, these are not and can't be defined in the view.xml which is used for the resize command. So the watermarked images not being generated automatically and the width and height being null results in GraphQl not being able to serve images.

Additional info from Engcom

  1. Configure Watermark for Small and Thumbnail product image in Content > Design > Configuration https://docs.magento.com/user-guide/catalog/product-image-watermarks.html watermark_config
  2. Create a new Simple Product and add Thumbnail and Small image thum_small
  3. Open the created product on Storefront and assert that the Product images have Watermarks prod_im_water
  4. Perform GraphQL query
    query {
    productDetail: products(
    pageSize: 5
    filter: {
       sku: { eq: "Test product" }
    }
    ) {
    total_count
    items {
      sku
      id
      name
      image {
        url
        label
      }
      thumbnail{
        url
      }
      small_image{
          url
          label
      }
      }
    }
    }
  5. Open the Small image link from the response
    {
    "data": {
    "productDetail": {
      "total_count": 1,
      "items": [
        {
          "sku": "Test product",
          "id": 1203,
          "name": "Test product",
          "image": {
            "url": "http://mage2.loc/static/version1608625882/frontend/Magento/luma/en_US/Magento_Catalog/images/product/placeholder/image.jpg",
            "label": "Test product"
          },
          "thumbnail": {
            "url": "http://mage2.loc/media/catalog/product/cache/56609834e2ecc3df17fcf9b0931a92fc/l/a/largerthan2mb.jpg"
          },
          "small_image": {
            "url": "http://mage2.loc/media/catalog/product/cache/56609834e2ecc3df17fcf9b0931a92fc/a/d/adobestock_229928445.jpeg",
            "label": "Test product"
          }
        }
      ]
    }
    }
    }

    Actual Result im_ar

m2-assistant[bot] commented 3 years ago

Hi @Hexmage. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


: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, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] commented 3 years ago

Hi @engcom-Bravo. 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:

engcom-Bravo commented 3 years ago

Hello @Hexmage

Thank you for your report

We confirm that the issue is reproducible on the latest 2.4-develop Additional info from Engcom is added to the Description

magento-engcom-team commented 3 years ago

:white_check_mark: Confirmed by @engcom-Bravo Thank you for verifying the issue. Based on the provided information internal tickets MC-40107 were created

Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!

Hexmage commented 3 years ago

Still an issue

SilinMykola commented 3 years ago

@magento I am working on this

Vinai commented 2 years ago

Why is this a P3?

yogesh-valiya commented 2 years ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 2 years ago

Hi @yvaliya. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 2 years ago

Hi @yvaliya, here is your Magento Instance: https://8fbcb829154c6a6a305343acfe9fb650.instances.magento-community.engineering Admin access: https://8fbcb829154c6a6a305343acfe9fb650.instances.magento-community.engineering/admin_b90c Login: 67f3dcc8 Password: 6010c9cb8d6c

engcom-Bravo commented 2 months ago

Hi @Hexmage,

Thanks for your reporting and collaboration.

We have verified the issue in Latest 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots.

Screenshot 2024-07-05 at 11 36 48 Screenshot 2024-07-05 at 11 36 41

image is not showing with watermark.

Hence Confirming the issue.

Thanks.

github-jira-sync-bot commented 2 months ago

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

m2-assistant[bot] commented 2 months ago

:white_check_mark: Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.