How do I automatically generate a favicon?

Asked

Viewed 49 times

0

Hello, I am creating a login API for clients, when the user generates "the page" he uploads your company logo to the server, but in addition to uploading the logo creates also generate a favicon automatically, someone has idea of how to do?

1 answer

1


Hello.

In the past, favicon was used a lot. ico, today all modern browsers already support png, which even provides higher quality and flexibility.

Simply resize the user sent image and save it in . png format to start using. You can do it in several dimensions(16,32,64,96 etc.) but the default is to use 32x32 pixels. I don’t know which language your API has programmed, but there are libraries that do this or other Apis that do this for you.

I recommend you offer a feature that the user can cut the area to be used inside the image, because the user can send an image with a large spacing from the logo to the edge, making it smaller as favicon. The ideal is to soon be as close to the edge as possible for better use. Or another field intended only to favicon same.

Good luck.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.