Dynamically generated Favicon Icon is very small in IE and edge.
up vote
0
down vote
favorite
I am trying to call API which return binary data (base64). When I upload an image,it get stored in the DB in binary format and page icon gets dynamically updated. In chrome and Firefox, page icon is visible and work as expected. However in Edge and IE, image looks too small and stretched. Someone have any idea what should I do?
document.title = title;
var src = "api/file/getPageLogo";
src = src + '?=' + Math.random();
var link = document.createElement('link'),
oldLink = document.getElementById('dynamic-favicon');
link.id = 'dynamic-favicon';
link.rel = 'icon';
link.href = src;
if (oldLink) {
document.head.removeChild(oldLink);
}
document.head.appendChild(link);
Does not work in IE
Works in Chrome
javascript html dom webpage favicon
add a comment |
up vote
0
down vote
favorite
I am trying to call API which return binary data (base64). When I upload an image,it get stored in the DB in binary format and page icon gets dynamically updated. In chrome and Firefox, page icon is visible and work as expected. However in Edge and IE, image looks too small and stretched. Someone have any idea what should I do?
document.title = title;
var src = "api/file/getPageLogo";
src = src + '?=' + Math.random();
var link = document.createElement('link'),
oldLink = document.getElementById('dynamic-favicon');
link.id = 'dynamic-favicon';
link.rel = 'icon';
link.href = src;
if (oldLink) {
document.head.removeChild(oldLink);
}
document.head.appendChild(link);
Does not work in IE
Works in Chrome
javascript html dom webpage favicon
what is the file type and dimensions and content of the file
– Bravo
Nov 9 at 4:18
Original file which is allowed to be uploaded is in png format, dimensions is 32*32. The file is stored in binary format in the DB which looks like 0x89504E470D0A1A0A0000000D494844520000.......
– Sac
Nov 9 at 4:31
Maybe check out this site? realfavicongenerator.net He has an FAQ page that explains a lot and an API that might be able to get you a file that works in IE.
– Will
Nov 9 at 8:08
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to call API which return binary data (base64). When I upload an image,it get stored in the DB in binary format and page icon gets dynamically updated. In chrome and Firefox, page icon is visible and work as expected. However in Edge and IE, image looks too small and stretched. Someone have any idea what should I do?
document.title = title;
var src = "api/file/getPageLogo";
src = src + '?=' + Math.random();
var link = document.createElement('link'),
oldLink = document.getElementById('dynamic-favicon');
link.id = 'dynamic-favicon';
link.rel = 'icon';
link.href = src;
if (oldLink) {
document.head.removeChild(oldLink);
}
document.head.appendChild(link);
Does not work in IE
Works in Chrome
javascript html dom webpage favicon
I am trying to call API which return binary data (base64). When I upload an image,it get stored in the DB in binary format and page icon gets dynamically updated. In chrome and Firefox, page icon is visible and work as expected. However in Edge and IE, image looks too small and stretched. Someone have any idea what should I do?
document.title = title;
var src = "api/file/getPageLogo";
src = src + '?=' + Math.random();
var link = document.createElement('link'),
oldLink = document.getElementById('dynamic-favicon');
link.id = 'dynamic-favicon';
link.rel = 'icon';
link.href = src;
if (oldLink) {
document.head.removeChild(oldLink);
}
document.head.appendChild(link);
Does not work in IE
Works in Chrome
javascript html dom webpage favicon
javascript html dom webpage favicon
asked Nov 9 at 4:06
Sac
135
135
what is the file type and dimensions and content of the file
– Bravo
Nov 9 at 4:18
Original file which is allowed to be uploaded is in png format, dimensions is 32*32. The file is stored in binary format in the DB which looks like 0x89504E470D0A1A0A0000000D494844520000.......
– Sac
Nov 9 at 4:31
Maybe check out this site? realfavicongenerator.net He has an FAQ page that explains a lot and an API that might be able to get you a file that works in IE.
– Will
Nov 9 at 8:08
add a comment |
what is the file type and dimensions and content of the file
– Bravo
Nov 9 at 4:18
Original file which is allowed to be uploaded is in png format, dimensions is 32*32. The file is stored in binary format in the DB which looks like 0x89504E470D0A1A0A0000000D494844520000.......
– Sac
Nov 9 at 4:31
Maybe check out this site? realfavicongenerator.net He has an FAQ page that explains a lot and an API that might be able to get you a file that works in IE.
– Will
Nov 9 at 8:08
what is the file type and dimensions and content of the file
– Bravo
Nov 9 at 4:18
what is the file type and dimensions and content of the file
– Bravo
Nov 9 at 4:18
Original file which is allowed to be uploaded is in png format, dimensions is 32*32. The file is stored in binary format in the DB which looks like 0x89504E470D0A1A0A0000000D494844520000.......
– Sac
Nov 9 at 4:31
Original file which is allowed to be uploaded is in png format, dimensions is 32*32. The file is stored in binary format in the DB which looks like 0x89504E470D0A1A0A0000000D494844520000.......
– Sac
Nov 9 at 4:31
Maybe check out this site? realfavicongenerator.net He has an FAQ page that explains a lot and an API that might be able to get you a file that works in IE.
– Will
Nov 9 at 8:08
Maybe check out this site? realfavicongenerator.net He has an FAQ page that explains a lot and an API that might be able to get you a file that works in IE.
– Will
Nov 9 at 8:08
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
Actual problem was even if the image dimensions were 32*32, while converting it into base64 format, the code was converting dimensions to 200 * 60 which was required to achieve the other functionality.
var base64Data = FileTools.GetResizedImageBase64FromDataUri(image.FileData, 200, 60);
simply by separating the logic's to achieve two different functionality and changing the dimension of one to 32*32 solved the issue.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Actual problem was even if the image dimensions were 32*32, while converting it into base64 format, the code was converting dimensions to 200 * 60 which was required to achieve the other functionality.
var base64Data = FileTools.GetResizedImageBase64FromDataUri(image.FileData, 200, 60);
simply by separating the logic's to achieve two different functionality and changing the dimension of one to 32*32 solved the issue.
add a comment |
up vote
0
down vote
accepted
Actual problem was even if the image dimensions were 32*32, while converting it into base64 format, the code was converting dimensions to 200 * 60 which was required to achieve the other functionality.
var base64Data = FileTools.GetResizedImageBase64FromDataUri(image.FileData, 200, 60);
simply by separating the logic's to achieve two different functionality and changing the dimension of one to 32*32 solved the issue.
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Actual problem was even if the image dimensions were 32*32, while converting it into base64 format, the code was converting dimensions to 200 * 60 which was required to achieve the other functionality.
var base64Data = FileTools.GetResizedImageBase64FromDataUri(image.FileData, 200, 60);
simply by separating the logic's to achieve two different functionality and changing the dimension of one to 32*32 solved the issue.
Actual problem was even if the image dimensions were 32*32, while converting it into base64 format, the code was converting dimensions to 200 * 60 which was required to achieve the other functionality.
var base64Data = FileTools.GetResizedImageBase64FromDataUri(image.FileData, 200, 60);
simply by separating the logic's to achieve two different functionality and changing the dimension of one to 32*32 solved the issue.
answered Nov 16 at 1:17
Sac
135
135
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53219729%2fdynamically-generated-favicon-icon-is-very-small-in-ie-and-edge%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
what is the file type and dimensions and content of the file
– Bravo
Nov 9 at 4:18
Original file which is allowed to be uploaded is in png format, dimensions is 32*32. The file is stored in binary format in the DB which looks like 0x89504E470D0A1A0A0000000D494844520000.......
– Sac
Nov 9 at 4:31
Maybe check out this site? realfavicongenerator.net He has an FAQ page that explains a lot and an API that might be able to get you a file that works in IE.
– Will
Nov 9 at 8:08