Fix problem with jpg icons (#2612)

This commit is contained in:
ligi 2023-04-08 22:33:09 +02:00 committed by GitHub
parent 6ebee71b81
commit e1f4241788
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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