Search code examples
imagejpeg

.jpg file compression as a url parameter


I noticed that the following file from a website could compress the image depending on the size passed as parameters in the url.

This is the following url.

 https://images.pexels.com/photos/207301/pexels-photo-207301.jpeg

and when passed as a parameter :

 https://images.pexels.com/photos/207301/pexels-photo-207301.jpeg?w=440&auto=compress&cs=tinysrgb

it gives a smaller image.

Now what I did:

I downloaded the image uploaded it to my website: http://auraquotes.com/images/pexels-photo-207301.jpeg

I also tried passing the parameters: http://auraquotes.com/images/pexels-photo-207301.jpeg?w=440&auto=compress&cs=tinysrgb

but nothing happened.

I wonder the reason?


Solution

  • That website is running a solution called imgix which handles the image request and the compression. Without imgix installed, you won't get the same effect.