feat: support greyscale a gif

This commit is contained in:
2024-10-29 11:47:25 +08:00
parent 40d4661e1b
commit 9af2916dfc
2 files changed
+15 -7

No files matched your search

@@ -100,7 +100,7 @@ class AsciiArtCommand : BaseCommand() {
try {
decoder.read(gifStream)
if (decoder.frameCount == 0) {
val bufferedImage = withContext(Dispatchers.IO) { ImageIO.read(URI(url).toURL()) }
val bufferedImage = withContext(Dispatchers.IO) { ImageIO.read(gifStream) }
val imageBytes = bufferedImage.convertToAscii()
.saveAsciiArtToImage(bufferedImage.width, bufferedImage.height)
.toByteArray()