Custom icons in badges #8872
-
I can use custom icon on badge? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
You can pass a base64 encoded custom logo as a query parameter. There are docs on this at https://github.com/badges/shields/blob/master/doc/logos.md#custom-logos However, there is a bit of a constraint on this: There is a limit on the total size of request headers we can accept (8192 bytes). This means the base64-encoded image text is limited to somewhere slightly under 8192 bytes depending on the rest of the request header. In practice, this usually means that your custom logo needs to be a SVG. We theoretically can accept a PNG in a base64 string but most real-world PNGs are too big and hit the size limit. |
Beta Was this translation helpful? Give feedback.
You can pass a base64 encoded custom logo as a query parameter. There are docs on this at https://github.com/badges/shields/blob/master/doc/logos.md#custom-logos However, there is a bit of a constraint on this: There is a limit on the total size of request headers we can accept (8192 bytes). This means the base64-encoded image text is limited to somewhere slightly under 8192 bytes depending on the rest of the request header.
In practice, this usually means that your custom logo needs to be a SVG. We theoretically can accept a PNG in a base64 string but most real-world PNGs are too big and hit the size limit.