mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 22:09: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;
|
ImageLink link;
|
||||||
link.m_url = imageUrl;
|
link.m_url = imageUrl;
|
||||||
QFileInfo info(basePath, imageUrl);
|
QFileInfo info(basePath, purifyUrl(imageUrl));
|
||||||
if (info.exists()) {
|
if (info.exists()) {
|
||||||
if (info.isNativePath()) {
|
if (info.isNativePath()) {
|
||||||
// Local file.
|
// 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 VUtils::linkUrlToPath(const QString &p_basePath, const QString &p_url)
|
||||||
{
|
{
|
||||||
QString fullPath;
|
QString fullPath;
|
||||||
QFileInfo info(p_basePath, p_url);
|
QFileInfo info(p_basePath, purifyUrl(p_url));
|
||||||
if (info.exists()) {
|
if (info.exists()) {
|
||||||
if (info.isNativePath()) {
|
if (info.isNativePath()) {
|
||||||
// Local file.
|
// Local file.
|
||||||
@ -569,7 +569,7 @@ bool VUtils::isImageURL(const QUrl &p_url)
|
|||||||
|
|
||||||
bool VUtils::isImageURLText(const QString &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());
|
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;
|
QString uri;
|
||||||
Q_ASSERT(!p_url.isRelative());
|
Q_ASSERT(!p_url.isRelative());
|
||||||
QString file = p_url.isLocalFile() ? p_url.toLocalFile() : p_url.toString();
|
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())) {
|
if (!QImageReader::supportedImageFormats().contains(suffix.toLatin1())) {
|
||||||
return uri;
|
return uri;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user