3 ms·
If you want to import external images, I would lean towards preserving the URL. Therefore, a GET param for the image. Also, what if the URL of the image has th
by koliber 10y ago
If you want to import external images, I would lean towards preserving the URL. Therefore, a GET param for the image.
Also, what if the URL of the image has the word "500x" or "resize" in it?
The non-GET-param solutions make me think too much:
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 transformation instructions can still be passed as part of the path, or as a GET param. Heck, support both.
- 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.