resize favicon to letterbox

This commit is contained in:
creeper123123321 2021-08-02 04:10:23 -03:00
parent 4942ce9da9
commit fde5f1293e

View File

@ -3,6 +3,8 @@ package com.viaversion.aas.config
import com.viaversion.aas.secureRandom
import com.viaversion.viaversion.util.Config
import net.coobird.thumbnailator.Thumbnails
import net.coobird.thumbnailator.filters.Canvas
import net.coobird.thumbnailator.geometry.Positions
import java.io.ByteArrayOutputStream
import java.io.File
import java.net.URI
@ -28,6 +30,7 @@ object VIAaaSConfig : Config(File("config/viaaas.yml")) {
ByteArrayOutputStream().also {
Thumbnails.of(URL(rawUrl))
.size(64, 64)
.addFilter(Canvas(64, 64, Positions.CENTER, false))
.outputFormat("png").toOutputStream(it)
}.toByteArray()
)