mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2024-11-15 10:55:27 +01:00
resize favicon to letterbox
This commit is contained in:
parent
4942ce9da9
commit
fde5f1293e
@ -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()
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user