Resizing or compression with Glitch CDN?

I’ve noticed that when we use Glitch CDN links, it appends a parameter v (I guess ‘version’) onto the URL.

I was wondering whether any other undocumented parameters exist for fixing height, width, or compression, to make images smaller.

Sometimes I upload a 1MB image at 2000x2000 but I only want to display it at 800x800. I have to resize and re-export it myself in IrfanView so it would be cool if the CDN could do it. Same goes for jpeg quality.

Anyone know?

You could try to append gzip headers to retrieve gzipped files if that is an issue, however other than that I’m rather very unsure.

Thank you for the suggestion. In my opinion, gzipping a 1MB image is still a waste if the image only needs to be 170kb at display resolution. But really, thanks! :slight_smile:

Anytime!

Anyway, to be completely honest the Glitch CDN is probably not the right choice for the majority of people, the CDN lack a lot of features, like you said yourself regarding resizing, quality, and compression.

I have an image on my site, eddiestech.co.uk, that takes about a year to load. It’s from a DSLR so makes sense, but would be cool to compress it without using another site/software

1 Like

On the contrary, it probably is the right choice for the majority of users, but perhaps not for the minority of power users? :wink:

I can recommend IrfanView as a dead simple free image editor. It has been around for years and years but it does a great job of resizing and compression. Open your image, Ctrl+R to resize, set a new percentage (it preserves aspect ratio by default), hit S to Save as, set the jpeg quality… done! :camera::sparkles:

That said, I understand that it would be easier not to have to edit the image manually :slight_smile:

True, it really depends on the targeted users. I guess the Glitch CDN is a very simple CDN to use, however I’m not sure of how good it actually is when it comes to response times and so on.

I use paint.net most of the time. It’s also free :slight_smile:

I don’t think there are any other parameters, the v parameter is just to force the browser to retrieve a new version of the file.

1 Like

Good shout, I expect that’s true.

I had a mess around and tried w, h, c and q params, none of which did anything.

1 Like

What about width and height?

As far as we know, the assets CDN is a very thin layer on Amazon S3, and S3 doesn’t have that kind of functionality. I would expect the assets system not to add it. But if it really were undocumented, of course I wouldn’t know either 🤷

I don’t think the v parameter is done at the server even. Does putting in an older number really get a previous version? It looks like it’s more meant to bust caches in between S3 and a client.

1 Like