From 7c68459666af96da7167c5f22684915895ee7e3f Mon Sep 17 00:00:00 2001 From: Mrs4s Date: Sat, 10 Jun 2023 16:15:57 +0800 Subject: [PATCH] fix private image size --- client/image.go | 4 ++++ message/image.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/client/image.go b/client/image.go index 394ffd21..d8646009 100644 --- a/client/image.go +++ b/client/image.go @@ -227,6 +227,7 @@ func (c *QQClient) QueryFriendImage(target int64, hash []byte, size int32) (*mes return &message.FriendImageElement{ ImageId: rsp.ResourceId, Md5: hash, + Size: size, Url: "https://c2cpicdw.qpic.cn/offpic_new/0/" + rsp.ResourceId + "/0?term=2", }, errors.WithStack(ErrNotExists) } @@ -234,6 +235,9 @@ func (c *QQClient) QueryFriendImage(target int64, hash []byte, size int32) (*mes ImageId: rsp.ResourceId, Md5: hash, Url: "https://c2cpicdw.qpic.cn/offpic_new/0/" + rsp.ResourceId + "/0?term=2", + Size: size, + Height: rsp.Height, + Width: rsp.Width, }, nil } diff --git a/message/image.go b/message/image.go index 5d03744d..f4cd2d82 100644 --- a/message/image.go +++ b/message/image.go @@ -29,6 +29,8 @@ type FriendImageElement struct { ImageId string Md5 []byte Size int32 + Width int32 + Height int32 Url string Flash bool @@ -151,6 +153,8 @@ func (e *FriendImageElement) Pack() []*msg.Elem { ResId: proto.Some(e.ImageId), OldPicMd5: proto.Some(false), PicMd5: e.Md5, + PicHeight: proto.Some(e.Height), + PicWidth: proto.Some(e.Width), DownloadPath: proto.Some(e.ImageId), Original: proto.Int32(1), }