Confusion with Gravatar URLs

I'm having problems getting Gravatars to work correctly:

When I request the following:

http://gravatar.com/avatar/8a17d0d0d8bdf6a8d527bbc943a17cf8.jpg?s=64&d=identicon

Firefox proudly displays the following:
http://files.quickmediasolutions.com/gravatar_p.png

... indicates that the file is a PNG image.

It bothers me - I thought Gravatars were JPEG images. Looks like they can be too. How do I know if a given PNG or JPEG image is preferable without first downloading it?


Note. Some people report that Gravatar returns only PNG images. Please explain this:

http://files.quickmediasolutions.com/gravatar_p2.png

http://gravatar.com/avatar/03cd042b82ac85b2c5fe0757a94e0413?s=64&d=identicon
+3
source share
2 answers

If the Gravatar badges have the exact MIME types assigned by the server you are accessing, just check this. It should be image/jpegfor JPEG and image/pngfor PNG.

Otherwise...

http://en.wikipedia.org/wiki/Portable_Network_Graphics#File_header

The PNG file begins with an 8-byte signature. The hexadecimal byte values ​​are 89 50 4E 47 0D 0A 1A 0A; decimal values ​​are 137 80 78 71 13 10 26 10.

, ; PNG, , , . , , - ( , , ) - , . , PHP, . ( ?)


, PNG:

50 4E 47 ASCII PNG, , .

+1

- JPG, . PNG.

0

Source: https://habr.com/ru/post/1751807/


All Articles