Changing Image Size by URL

Highlighted
New Member
1 0 0

The question to anyone that chooses to accept it. Is it possible to use the Shopify API to change the image size by its URL? I found the following information for doing this process using FileStack API and figured that the Shopify community had enough Brainiacs to help me make this happen. Here's the info I found:

All we’re am going to do is append some simple parameters to the URL. That’s it. No messing around with CSS. No opening up Photoshop. No installing and configuring ImageMagick.

We’ll just take the image URL that we want to transform (e.g. my S3 object url or in this case, Wikipedia Url), add the Filestack transformation API endpoint, an API key and the conversion parameter.

https://cdn.filestackcontent.com/[API-key]/[Conversion-Task]/[external-url]

Let’s start by resizing to a width of 200px and height of 200 px by adding resize=width:200,height:200 to our base url.

Original URL

https://cdn.filestackcontent.com/ARVNFDkIFTCy2nOXvYSoLz/output=secure:true/security=policy:eyJleHBpcnkiOiAxNTYwNTUwMjg1LCAiY2FsbCI6IFsicmVhZCIsICJzdGF0IiwgImNvbnZlcnQiLCAicGljayIsICJzdG9yZSJdfQ==,signature:5c96c569ede1a84d5e7b4f996f9b7083b377f27248032a48c3b6b084336def41/RH0aePntTSa8sjSmSDbZ

 URL with Re-Size added

https://cdn.filestackcontent.com/resize=width:200,height:200/ARVNFDkIFTCy2nOXvYSoLz/output=secure:true/security=policy:eyJleHBpcnkiOiAxNTYwNTUwMjg1LCAiY2FsbCI6IFsicmVhZCIsICJzdGF0IiwgImNvbnZlcnQiLCAicGljayIsICJzdG9yZSJdfQ==,signature:5c96c569ede1a84d5e7b4f996f9b7083b377f27248032a48c3b6b084336def41/RH0aePntTSa8sjSmSDbZ

 If this is possible can someone please assist me with this as I am new to the world of tech and e-commerce but I learn fast and implement faster. 

0 Likes
Shopify Partner
1054 115 169

It is possible to achieve the same using Shopify's image filters for Liquid. Have a look here - https://help.shopify.com/en/themes/liquid/filters/url-filters#asset_img_url

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
0 Likes