Method of detecting if a ROBLOX supplied image endpoint failed to load?

In this example I am loading the player’s avatar image from these web endpoints:

https://www.roblox.com/bust-thumbnail/image?userId=USER_ID&width=420&height=420&format=png
https://www.roblox.com/headshot-thumbnail/image?userId=USER_ID&width=420&height=420&format=png

If the player has recently changed their avatar, the endpoint returns the generic N/A image that we know all too well.

Image

https://i.imgur.com/btWh06n.png

Is there any way to detect if the endpoint returns this placeholder image? It really is an eyesore in games that rely on these endpoints for user-avatar images.

Fm

There is a dedicated API method for this:
http://wiki.roblox.com/index.php?title=API:Class/Players/GetUserThumbnailAsync

3 Likes

/facedesk

Regarding non in-game use, if you use the json API: https://www.roblox.com/bust-thumbnail/json?userId=2470023&width=420&height=420&format=png the “final” property is false if the image hasn’t loaded yet and true once it has loaded.

1 Like