CDN Image URLs with resize parameters do not work in HTML editor on pages and blog posts

CDN Image URLs with resize parameters do not work in HTML editor on pages and blog posts

friendscottn
Shopify Partner
16 3 8

I'm noticing that image URLs like this one:

https://cdn.shopify.com/static/sample-images/garnished.jpeg?width=700&crop=center

are rewritten once saved once by the HTML editor in the online store app to look like:

https://cdn.shopify.com/static/sample-images/garnished.jpeg?width=700&crop=center

 

HTML escaping the URL parameter with & breaks the functionality of the URL parameter and the crop does not crop in this case. This seems like a bug that needs to be fixed in the HTML editor used throughout Shopify. I reproduced the same issue in the product HTML editor.

Replies 2 (2)

Small_Task_Help
Shopify Partner
508 15 35

Hi,

 

It is not an issue, these are HTML Entities

 

html.png

Click here to Contact and Get Shopify Store Help
E-mail - hi@ecommercesmalltask.com
We are Shopify Experts   from Ecommerce Small Task Company.
friendscottn
Shopify Partner
16 3 8

Okay right, but those HTML encoded symbols do not belong in image URLs.

I probably should have used a better example than an image that didn't need a crop. Look at these two:

works:

https://cdn.shopify.com/static/sample-images/garnished.jpeg?width=700&height=100&crop=center

doesn't work:

https://cdn.shopify.com/static/sample-images/garnished.jpeg?width=700&height=100&crop=center

 

So, in summary, if you try to use Shopify's own CDN image resize parameters inside of a Shopify HTML editor it gets broken on any subsequent saves of the editor.