FB Profile Pic always returned as “.jpg”?

后端 未结 3 479
遥遥无期
遥遥无期 2021-01-21 15:36

Trying to pull user images via the Facebook Social Graph.

Finding it odd that no matter what I upload the image as (gif, bmp, tiff, or jpg), my call to https://graph.fac

3条回答
  •  离开以前
    2021-01-21 16:23

    That's because FaceBook stores it as a jpg, because that is in general the most efficient image format for pictures. It's always a good idea to check if the data is what you expect. Checking image type is quite easy. It will always be a web format, which basically comes down to jpg, png and gif, with gif being very unlikely because of its limitations (GIF can contain 256 colors at most, and is generally larger than png. Has license limitations too). BMP is not a web format and cannot be displayed in most browsers. You will not get a BMP from that url.

提交回复
热议问题