Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default “blank” parameter produce different result when passing different value to the size parameter #169

Open
thomaspaillot opened this issue Mar 3, 2025 · 7 comments
Assignees

Comments

@thomaspaillot
Copy link

Bug Report

Description / Observed Behavior

When using the d=blank parameter to have a transparent image when a user has no avatar and also passing the s=100 parameter, different images are generated when passing differents sizes. For some sizes a completely transparent image is generated and for others a completely black image is generated.

Expected Behavior

I expect to always get a transparent image when using the d=blank parameter.

Repro Steps / Code Example

This url produce a transparent image:
https://www.gravatar.com/avatar/hash?d=blank&s=32

This one produce a black image:
https://www.gravatar.com/avatar/hash?d=blank&s=20

Your Environment

  • Component/Service Name and Version: Avatar API
  • Platform: Web
  • Operating System / Browser: MacOS / Chrome, Firefox
@johngodley johngodley self-assigned this Mar 3, 2025
@johngodley
Copy link
Member

We are looking into this.

@johngodley
Copy link
Member

Other than the above hash URL, was there a real Gravatar URL that you had a problem with?

@jordan-intuiface
Copy link

I'm facing the same issue but with same size in different URLs. I could not figured out what is happening but it seems that using the force default parameter is a workaround

@andrewtelliott
Copy link

andrewtelliott commented Mar 5, 2025

Thanks for taking a look @johngodley. My team has noticed it for our 80px images. It's interesting that it occurs only at some sizes:
Black @ 80px: https://gravatar.com/avatar/ffd210f9ad410e518be60ab02b7cc02d?d=blank&s=80
Transparent @ 81px: https://gravatar.com/avatar/ffd210f9ad410e518be60ab02b7cc02d?d=blank&s=81

These sizes all came back black: 11, 16, 17, 18, 21, 22, 26, 29, 31, 35, 36, 37, 38, 40, 42, 44, 45

Update:
Calling the size as the first parameter brings back the expected result.
Black @ 80px: https://gravatar.com/avatar/ffd210f9ad410e518be60ab02b7cc02d?d=blank&s=80
Transparent @ 80px: https://gravatar.com/avatar/ffd210f9ad410e518be60ab02b7cc02d?s=80&d=blank

@johngodley
Copy link
Member

@andrewtelliott I couldn't reproduce it with those URLs and sizes. You may have already done it, but just to check, have you cleared your browser cache?

@andrewtelliott
Copy link

@johngodley Neither can I any more. I think the cache cleared and the issue on that url is not present (the reversing parameter order might have been a coincidence). I am seeing that same issue with the "hash" url in @thomaspaillot 's initial issue. With s=20 returning black and s=21 returning transparent (even after clearing local cache). Smells like a hiccup + CDN caching to me.

@jordan-intuiface
Copy link

jordan-intuiface commented Mar 5, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants