I'm trying to get JPG images from Gravatar by adding .jpg at the end of the hash, like this: https://www.gravatar.com/avatar/00000000000000000000000000000000.jpg?d=wavatar&f=y
However, if I save it to the disk like this:
file_put_contents($path, file_get_contents('https://www.gravatar.com/avatar/00000000000000000000000000000000.jpg?d=wavatar&f=y'));
Or if I save it directly from the browser to my computer I notice that the file is in fact a PNG image.
Why is that?
Am I missing something?
Thks!
That link will give you png file even you have jpg at the end. If you want a jpeg image, try this in your php.
Code at phponline and download this jpeg image.