3 ms·
> Also, what if the URL of the image has the word "500x" or "resize" in it? I'm supporting images that end in .jpg, .png, or .gif. So currently I know that any
by nkkollaw 10y ago
> Also, what if the URL of the image has the word "500x" or "resize" in it?
I'm supporting images that end in .jpg, .png, or .gif. So currently I know that anything after the extension is parameters.
> 1. Take the domain, and change any dots to dashes. What if there's a subdomain, or three levels of subdomains? 2. Add the domain as a subdomain on imagekick.io 3. Take the rest of the URL and add it as the path 4. Add the transformations on top of it
The rationale was that to create a resize/manipulation URL you only had to change the domain. For instance:
//example.com/image/dog.jpg becomes: whateveryouchooseassubdomain.imagekick.io/image/dog.jpg
Also, if you don't add parameters the image is served via a CDN, so potentially one could use this just to easily add a CDN to his images.
> Heck, support both.
Yes, I thought about that as well. It could be kind of confusing to explain, though. I'd rather pick the best way and just do that.