Fix problem with jpg icons

This commit is contained in:
ligi 2023-04-08 22:30:11 +02:00
parent 6ebee71b81
commit 453c445b45
No known key found for this signature in database
GPG Key ID: 8E81894010ABF23D

View File

@ -218,8 +218,9 @@ fun checkIcon(icon: File, withIconDownload: Boolean, allIconCIDs: MutableSet<Str
val imageReader = ImageIO.getImageReaders(imageInputStream).next() val imageReader = ImageIO.getImageReaders(imageInputStream).next()
val image = ImageIO.read(imageInputStream) val image = ImageIO.read(imageInputStream)
if (imageReader.formatName != format) { val formatOfIconDownload = imageReader.formatName.replace("JPEG", "jpg")
error("format in json ($icon) is $format but actually is in imageDownload ${imageReader.formatName}") if (formatOfIconDownload != format) {
error("format in json ($icon) is $format but actually is in imageDownload $formatOfIconDownload")
} }
if (image.width != width) { if (image.width != width) {
error("width in json ($icon) is $width but actually is in imageDownload ${image.width}") error("width in json ($icon) is $width but actually is in imageDownload ${image.width}")