mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
MdEditOperations: check source image before insert from path
This commit is contained in:
parent
af39cf5232
commit
61909c2c5d
@ -155,6 +155,12 @@ void VMdEditOperations::insertImageFromPath(const QString &p_title,
|
|||||||
p_destImagePath.clear();
|
p_destImagePath.clear();
|
||||||
p_urlInLink.clear();
|
p_urlInLink.clear();
|
||||||
|
|
||||||
|
// Make sure src image is valid.
|
||||||
|
if (QImage(p_srcImagePath).isNull()) {
|
||||||
|
qWarning() << "fail to insert invalid source image" << p_srcImagePath;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QString fileName = VUtils::generateImageFileName(p_folderPath,
|
QString fileName = VUtils::generateImageFileName(p_folderPath,
|
||||||
p_title,
|
p_title,
|
||||||
QFileInfo(p_srcImagePath).suffix());
|
QFileInfo(p_srcImagePath).suffix());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user