Skip to content

Commit

Permalink
Update DialogPeer.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
lidaobing committed May 24, 2024
1 parent b77976a commit 4f414bb
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/iptux/DialogPeer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,16 @@ bool DialogPeer::SendTextMsg() {
/* 保存图片 */
chipmsg = g_strdup_printf("%s" IPTUX_PATH "/%" PRIx32,
g_get_user_config_dir(), count++);
gdk_pixbuf_save(pixbuf, chipmsg, "bmp", NULL, NULL);
/* 新建一个碎片数据(图片),并加入数据链表 */
ChipData chip(MESSAGE_CONTENT_TYPE_PICTURE, chipmsg);
dtlist.push_back(std::move(chip));
GError* error = nullptr;
gdk_pixbuf_save(pixbuf, chipmsg, "png", &error, NULL);
if (error) {
LOG_ERROR("failed to save image: %s", error->message);
g_error_free(error);
} else {
/* 新建一个碎片数据(图片),并加入数据链表 */
ChipData chip(MESSAGE_CONTENT_TYPE_PICTURE, chipmsg);
dtlist.push_back(std::move(chip));
}
}
} while (gtk_text_iter_forward_find_char(
&iter, GtkTextCharPredicate(giter_compare_foreach),
Expand Down

0 comments on commit 4f414bb

Please sign in to comment.