Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Return resized image paths #4

Closed
paliarush opened this issue Apr 4, 2018 · 5 comments
Closed

Return resized image paths #4

paliarush opened this issue Apr 4, 2018 · 5 comments
Labels
for-grooming This issue needs to be discussed before it can be worked on medium

Comments

@paliarush
Copy link
Contributor

paliarush commented Apr 4, 2018

As a Magento developer, I need GraphQL API to return resized image paths so that I can render storefront experiences with correctly sized images.

Acceptance criteria:

  1. GraphQL returns original image paths
  2. GraphQL returns resized image paths if the images have been resized
  3. Changes are covered with web API functional tests. See \Magento\GraphQl\Catalog\ProductViewTest::testQueryAllFieldsSimpleProduct as an example.
@paliarush paliarush added for-grooming This issue needs to be discussed before it can be worked on additional-coverage labels Apr 4, 2018
@paales
Copy link
Contributor

paales commented May 29, 2018

Although I agree that this would be a nice feature, this feature is not exclusive to GraphQL and might be more interesting as a general API. I had created the feature request earlier here: magento/community-features#44

We have recently implemented https://github.com/h2non/imaginary as an api for one of our customers, but it would be nice if such a thing could be directly in Magento. The most imporant part is that a serious frontend requires modern image formats for a fast website. Spending 50% extra on images because you have to use .jpg isn't a good idea.

For any serious client we revamp the functionality to:

  • Use render-dependent images (rendered large, downloads a large image, rendered small, download a small image).
  • Use connection-dependent images (slow connection, low quality image, fast connection, high quality image)
  • Serve jpg/png/webp based on it's context
  • Make sure all images are als optimized as possible.

To achieve this we use a client side webcomponent that requests the right image. It adds additional query parameters to the URL to download the correct one.

The advantage of using a query parameter is that you don't need to do a query to fetch the URL of a certain size of image (the size it is rendered).

magento-engcom-team pushed a commit that referenced this issue Jun 25, 2018
[Forwardport] Correct sentence in comment section in class file.
magento-engcom-team pushed a commit that referenced this issue Nov 29, 2018
magento 2.3-develop:update branch
magento-engcom-team pushed a commit that referenced this issue Dec 21, 2018
magento-engcom-team pushed a commit that referenced this issue Jan 19, 2019
magento-engcom-team pushed a commit that referenced this issue Feb 10, 2019
@id-mitchell
Copy link

I would find this functionality very useful to have as an option. I'm not sure requesting image sizes through GraphQL like this would be the best solution for a larger project, but again I think it would be very useful regardless. Based on the fact that this is still open and marked "for-grooming" I'm assuming this hasn't made it's way into any sort of development process yet? I didn't see anything in the docs or in the 2.3.0 codebase at least.

@paliarush
Copy link
Contributor Author

@id-mitchell we will probably focus on this after checkout coverage is done.

magento-engcom-team pushed a commit that referenced this issue Mar 25, 2019
magento-engcom-team pushed a commit that referenced this issue Apr 29, 2019
@naydav
Copy link
Contributor

naydav commented May 3, 2019

@naydav naydav removed the coverage label May 3, 2019
@naydav
Copy link
Contributor

naydav commented May 3, 2019

Will be checked in https://github.com/magento/graphql-ce/issues/611

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
for-grooming This issue needs to be discussed before it can be worked on medium
Projects
None yet
Development

No branches or pull requests

4 participants