cloudinary / cloudinary_magento2

Cloudinary's Magento 2 extension. Upload product images to the cloud, manipulate them to match your graphic design and optimize images for better user experience
MIT License
15 stars 8 forks source link

CLD-Transformation not processed #113

Closed azngeek closed 1 year ago

azngeek commented 2 years ago

I wanted to debug the Freeform-Feature in GraphQl-Pagebuilder. I wonder, how this code is working as the variable is a string but the expected data type for the method withFreeform is an object of type Freeform.

https://github.com/cloudinary/cloudinary_magento2/blob/6a87b14dd430708d7a7cb81804c3ac9927320ea7/Core/CloudinaryImageProvider.php#L120

This is my current situation:

$imageId = media/wysiwyg/AlleStoriesBlock_Kopie.jpg $this->productMediaConfig->getBaseMediaUrl() = https://abc.test/media/catalog/product $mapped->getFreeTransformation() = c_scale,f_auto,q_auto,w_669

So there are several issues.

  1. The strpos evaluation fails. I do not get the intention of this one.
  2. The method getFreeTransformation returns a string instead of the Freeform-Object.

image

wissam-khalili commented 2 years ago

Hi @azngeek ,

Could you please share some more context about what you are trying to do? What is the impact? What is the exact expectation? Which Magento version are you using?

Thanks, Wissam

azngeek commented 2 years ago

I try to get a page from the page builder using a graphql endpoint. I would expect the graphql endpoint to return a page which will contain transformed images using the "free transform" functionality.

However the content of the page builder does not contain the transformed cloudinary images but the original images. This is the part of the code i am trying to debug. In the current situation i do not understand under which condition the Freeform-Transformation should be applied.

wissam-khalili commented 2 years ago

Hi @azngeek ,

We try to get the home page using GraphQl and we get the page data with the image URL the same as on the homepage. For example Screenshot Screenshot https://res.cloudinary.com/m2clduat/image/upload/s--8qE6K2pN--/e_improve,r_5/c_lpad,d_ybcayyeh9qp7zoy59miz.jpg,dpr_2.0,f_auto,q_auto/v1/qa-career.png?_i=AB Also, we see that the getFreeTransformation method returns a string result and this is how it should be if you look at the code Screenshot.

Hope you find it helpful.

Regards, Wissam