Skip to content

Commit

Permalink
Fix size-less image sending; fix #1769
Browse files Browse the repository at this point in the history
  • Loading branch information
Karlatemp committed Dec 30, 2021
1 parent 1819374 commit 09920d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mirai-core/src/commonMain/kotlin/message/imagesImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ internal fun ImMsgBody.NotOnlineImage.toCustomFace(): ImMsgBody.CustomFace {
flag = ByteArray(4),
bigUrl = bigUrl,
origUrl = origUrl,
width = picWidth,
height = picHeight,
width = picWidth.coerceAtLeast(1),
height = picHeight.coerceAtLeast(1),
imageType = imgType,
//_400Height = 235,
//_400Url = "/gchatpic_new/000000000/1041235568-2195821338-01E9451B70EDEAE3B37C101F1EEBF5B5/400?term=2",
Expand Down Expand Up @@ -257,8 +257,8 @@ internal fun OfflineGroupImage.toJceData(): ImMsgBody.CustomFace {
picMd5 = this.md5,
flag = ByteArray(4),
size = size.toInt(),
width = width,
height = height,
width = width.coerceAtLeast(1),
height = height.coerceAtLeast(1),
imageType = getIdByImageType(imageType),
origin = if (imageType == ImageType.GIF) {
0
Expand Down

0 comments on commit 09920d3

Please sign in to comment.