microlinkhq / unavatar

Get unified user avatar from social networks, including Instagram, SoundCloud, Telegram, Twitter, YouTube & more.
https://unavatar.io
MIT License
1.21k stars 70 forks source link

Add transparent image fallback #351

Closed bencroker closed 2 months ago

bencroker commented 2 months ago

Thanks for the great work!

This PR allows fallback=transparent that returns a transparent, base64 encoded 1x1 pixel GIF. This can be useful when you want to use your own background colour or image as a fallback.

bencroker commented 2 months ago

Updated to the PR to return any fallback value that starts with data:.

Kikobeats commented 2 months ago

It's necessary to returns the fallback data uri as buffer properly

bencroker commented 2 months ago

I think I managed to to this correctly. Apologies if not, I’m trying to understand the application structure as I go.

Kikobeats commented 2 months ago

LGTM, thanks! :love-cry: