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
26 3 17

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
830 28 75

Hi,

 

It is not an issue, these are HTML Entities

 

html.png

To Get Shopify Experts Help, E-mail - hi@ecommercesmalltask.com
About Us - We are Shopify Expert Agency
At Google My Business - Ecommerce Small Task - Hire Shopify Developers Ahmedabad
friendscottn
Shopify Partner
26 3 17

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.