Using .ico in img tag
Asked Answered
H

1

6

I have faced next strange behavior in Firefox when use ico file as src in img tag. When It opens in Firefox (latest version), it has 16x16 format despite of the fact that ico original format is 128x128. In other browser (Chrome, IE) everything works great. Just open elephant-128x128.ico in Chrome and Firefox and you will see the difference.

<img height='128' src="http://icons.iconseeker.com/ico/cloth-dolls-icons/elephant-128x128.ico">


https://jsfiddle.net/qwx2sxzg/1/ 

or http://icons.iconseeker.com/ico/cloth-dolls-icons/elephant-128x128.ico Does anybody has idea how to fix this?

Heave answered 19/6, 2015 at 7:39 Comment(0)
I
5

Your best bet is to convert ico files to another format, since it is not compatible with all browsers.

Image Format Support For Web Browsers

There is no other workaround for it.

Inclinable answered 19/6, 2015 at 7:51 Comment(2)
Thank you, we decided pass size to the server and convert ico to png.Heave
@SergeyZubatkin you are welcome, make sure you save the converted image, so the server won't have to convert images on each request.Inclinable

© 2022 - 2024 — McMap. All rights reserved.