mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
fix local image path with query parameters
This commit is contained in:
parent
b27da44c7a
commit
6d1830ad86
@ -247,7 +247,7 @@ QVector<ImageLink> VUtils::fetchImagesFromMarkdownFile(VFile *p_file,
|
||||
|
||||
ImageLink link;
|
||||
link.m_url = imageUrl;
|
||||
QFileInfo info(basePath, imageUrl);
|
||||
QFileInfo info(basePath, purifyUrl(imageUrl));
|
||||
if (info.exists()) {
|
||||
if (info.isNativePath()) {
|
||||
// Local file.
|
||||
@ -288,7 +288,7 @@ QVector<ImageLink> VUtils::fetchImagesFromMarkdownFile(VFile *p_file,
|
||||
QString VUtils::linkUrlToPath(const QString &p_basePath, const QString &p_url)
|
||||
{
|
||||
QString fullPath;
|
||||
QFileInfo info(p_basePath, p_url);
|
||||
QFileInfo info(p_basePath, purifyUrl(p_url));
|
||||
if (info.exists()) {
|
||||
if (info.isNativePath()) {
|
||||
// Local file.
|
||||
@ -569,7 +569,7 @@ bool VUtils::isImageURL(const QUrl &p_url)
|
||||
|
||||
bool VUtils::isImageURLText(const QString &p_url)
|
||||
{
|
||||
QFileInfo info(p_url);
|
||||
QFileInfo info(purifyUrl(p_url));
|
||||
return QImageReader::supportedImageFormats().contains(info.suffix().toLower().toLatin1());
|
||||
}
|
||||
|
||||
|
@ -932,7 +932,7 @@ QString VWebUtils::dataURI(const QUrl &p_url, bool p_keepTitle) const
|
||||
QString uri;
|
||||
Q_ASSERT(!p_url.isRelative());
|
||||
QString file = p_url.isLocalFile() ? p_url.toLocalFile() : p_url.toString();
|
||||
QString suffix(QFileInfo(file).suffix().toLower());
|
||||
QString suffix(QFileInfo(VUtils::purifyUrl(file)).suffix().toLower());
|
||||
|
||||
if (!QImageReader::supportedImageFormats().contains(suffix.toLatin1())) {
|
||||
return uri;
|
||||
|
Loading…
x
Reference in New Issue
Block a user