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

Issue with MS Edge #37

Open
amrsalama opened this issue Oct 21, 2019 · 24 comments
Open

Issue with MS Edge #37

amrsalama opened this issue Oct 21, 2019 · 24 comments
Assignees

Comments

@amrsalama
Copy link

There is a weird behaviour in MS Edge, The image shifted to the top, any ideas ? Thanks!

Screenshot from 2019-10-21 20-49-18

@hotgeart
Copy link

No problem on my side.

@eSilverStrike
Copy link

eSilverStrike commented Nov 7, 2019

I am getting this issue as well. It works fine in Edge if you load it directly as @hotgeart did but if you include it in a web page with HTML the letters are not centred as the image shows which @amrsalama included. The same page does work fine on Firefox and Chrome.

I confirm that this bit of HTML will produce the error in Edge on my Windows 10 PC (tried several different PCs):

<div style="padding-top:3px;"><img width="115" height="115" title="Test" class="userphoto" alt="" src="https://ui-avatars.com/api/?name=TT&amp;color=FFFFFF&amp;background=784DD1&amp;size=128"><br>Status: offline</div>

Here is a JSFiddle showing the issue (must use Microsoft Edge to see the problem)

https://jsfiddle.net/y9sor1xc/

@cwmrowe
Copy link

cwmrowe commented Nov 20, 2019

We are also getting this issue, I think it is to do with the type of image you get back which is dependent upon the accept request header sent by the browser. When called from an <img> tag in Edge then the header is

   Accept: image/png, image/svg+xml, image/*; q=0.8, */*; q=0.5

Which results in the image type in the response being svg.

image

@cwmrowe
Copy link

cwmrowe commented Nov 20, 2019

On further investigation I'm not sure if it is the Accept header that is the problem, I tried it in Postman and got the correctly rendered image, but I am sure it is one of the request headers that's causing this issue.

@eSilverStrike
Copy link

I don't like the idea that a developer has not responded yet to this issue. I hope this project is not dead as we just incorporated it into our code.

@LasseRafn are there plans to continue to work on this project? I understand if you don't have time at the moment to work on a fix but it would make us feel better if their was some sort of response.

Thanks

@LasseRafn
Copy link
Owner

LasseRafn commented Dec 11, 2019 via email

@hotgeart
Copy link

I think we should wait. The 15 janv the new Edge based on chromium will be out. So the bug will disappear on its own. No?

source: https://blogs.windows.com/msedgedev/2019/11/04/edge-chromium-release-candidate-get-ready/#ck6RfDbJ1POYcebm.97

@eSilverStrike
Copy link

Is anyone running the Beta version of Edge to see if it is actually fixed? It still may not be if Chromium hands off rendering images or something...

If the new Edge fixes the issue it will still be a while before everyone is using it.

It's weird how it works fine in Edge if you access the image directly... cwmrowe seems to be onto something.

@hotgeart
Copy link

@eSilverStrike https://i.imgur.com/8RVSyyK.png It looks fine to me

@stof
Copy link
Contributor

stof commented Dec 17, 2019

IE 11 also have this bug. And unfortunately, in enterprise environments, IE 11 is not near disappearing yet.

@LasseRafn
Copy link
Owner

I tried installing Edge on Mac, to see how it looks (using the example from @hotgeart, http://jsfiddle.net/y9sor1xc) but could only find a beta which renders correctly, I guess it uses Chromium. I haven't been able to test it myself.

Anyone against simply having Edge return a PNG? as in:

User-agent is Edge/IE = return png no matter accept headers.

Unless of course someone has a proper solution? The SVG is valid and (as per other browsers) does work.. So I'd say its a Edge issue.

@eSilverStrike
Copy link

What are the disadvantages of returning a png? If it is just the size of the file then I don't have a problem as I rather have it look correct.

@LasseRafn
Copy link
Owner

Nothing except not using SVGs 👍 I can switch it to PNG-only by checking user-agent?

@eSilverStrike
Copy link

Another negative I guess would mean that you may have to store not only svg but png files as well on your web server.

Internet explorer and Edge both suffer from this issue so you want to detect all Internet Explorer browsers and Edge up to whatever version just before they start to use Chromium. User Agent is the only way I know of.

@cwmrowe
Copy link

cwmrowe commented Dec 21, 2019

Anything that makes it render right is great. Doesn't really matter if it's SVG or PNG. Thanks and Merry Christmas!

@nullifiedtsk
Copy link

anyway, it looks like a bug in online api service webserver config / api since it duplicates almost all headers content
image

@stof
Copy link
Contributor

stof commented Mar 5, 2020

@LasseRafn is the source code in this repo actually used ? From what I can tell, the source code here will never produce a SVG at all.

@LasseRafn
Copy link
Owner

@stof Thanks for pointing this out! Some changes were never synced 👎 I'll bring it up to date.

@nullifiedtsk This should hopefully be fixed now — however I will look into it

I'm pushing a fix soon which should make it render PNG for IE/Edge always. I don't particularly like this (as new Edge works fine) but lets do this for now and see if we can remove it in the future.

Apologies for the slow handling

@LasseRafn LasseRafn self-assigned this Mar 5, 2020
@stof
Copy link
Contributor

stof commented Mar 5, 2020

Actually, Chrome and Firefox are getting PNG, not SVG (and maybe new Edge too, but untested).

Here are the Accept header for <img> tags:

Chrome: image/webp,image/apng,image/*,*/*;q=0.8
Firefox: image/webp,*/*
IE 11: image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5
Edge 18: same than IE 11

@stof
Copy link
Contributor

stof commented Mar 5, 2020

So to me, this says that only browsers in which we have an issue are receiving the SVG avatar, so it might be broken.

Btw, IE 11 on Windows 7 has an additional issue. due to the height attribute on the <svg> tag, it overwrites the height: auto of the <img> in CSS

@stof
Copy link
Contributor

stof commented Mar 5, 2020

I added a parameter to force the format in #41

@LasseRafn
Copy link
Owner

@stof I'll look into the height — wondering how we will fix that though.. I dont have access to Windows 7 at the moment 👎🏻

Actually, Chrome and Firefox are getting PNG, not SVG (and maybe new Edge too, but untested).

Indeed weird! Safari passes a SVG to accept but maybe other browsers dont. Is this for newest versions?

@stof
Copy link
Contributor

stof commented Mar 6, 2020

This is for Firefox 73.0.1 (current stable channel) and Chromium 80 (current stable)

@jcrooke
Copy link

jcrooke commented Sep 7, 2020

To be clear to anyone who is getting this issue in IE11/Edge, the fix is to add &format=png on the request so that IE11/Edge gets a PNG in response. I've actually noticed that it'll randomly get back a PNG or an SVG if you do not specify &format=png.

eSilverStrike added a commit to Geeklog-Core/geeklog that referenced this issue Sep 7, 2020
Issue is with older MS Edge browser. Now return png instead of svg. Once issue fixed by image provider should revert back to svg.

See: LasseRafn/ui-avatars#37 (comment)
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

8 participants