From f7e6f610992da9c410ecaf4fad62b8e5e90f7b62 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 25 Oct 2023 09:56:27 +0800 Subject: [PATCH] :art: PDF files larger than 128MB are not included in asset file content searching https://github.com/siyuan-note/siyuan/issues/9500 --- .../20230805231816-h1z9mpc/20230805232134-3d6mx2k.sy | 11 ++++++----- .../20230805225107-qm1m2f5/20230805230218-aea8icj.sy | 11 ++++++----- .../20230805232719-04mqbcx/20230805232920-5fdco36.sy | 10 +++++----- kernel/model/asset_content.go | 4 ++-- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20230805231614-vqn28eh/20230805231816-h1z9mpc/20230805232134-3d6mx2k.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20230805231614-vqn28eh/20230805231816-h1z9mpc/20230805232134-3d6mx2k.sy index 6c42d38ad..329d9169b 100644 --- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20230805231614-vqn28eh/20230805231816-h1z9mpc/20230805232134-3d6mx2k.sy +++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20230805231614-vqn28eh/20230805231816-h1z9mpc/20230805232134-3d6mx2k.sy @@ -5,7 +5,7 @@ "Properties": { "id": "20230805232134-3d6mx2k", "title": "Search asset content", - "updated": "20231025095300" + "updated": "20231025095559" }, "Children": [ { @@ -215,7 +215,7 @@ "ListData": {}, "Properties": { "id": "20230903112419-45ps71g", - "updated": "20231025095300" + "updated": "20231025095559" }, "Children": [ { @@ -253,7 +253,8 @@ "Marker": "Kg==" }, "Properties": { - "id": "20231025095244-lpf6spo" + "id": "20231025095244-lpf6spo", + "updated": "20231025095559" }, "Children": [ { @@ -261,12 +262,12 @@ "Type": "NodeParagraph", "Properties": { "id": "20231025095244-m8ut4h2", - "updated": "20231025095244" + "updated": "20231025095559" }, "Children": [ { "Type": "NodeText", - "Data": "PDFs larger than 64MB or 1024 pages are not supported" + "Data": "PDFs larger than 128MB or 1024 pages are not supported" } ] } diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20230805222417-2lj3dvk/20230805225107-qm1m2f5/20230805230218-aea8icj.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20230805222417-2lj3dvk/20230805225107-qm1m2f5/20230805230218-aea8icj.sy index 9d754c1b4..951fd81bc 100644 --- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20230805222417-2lj3dvk/20230805225107-qm1m2f5/20230805230218-aea8icj.sy +++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20230805222417-2lj3dvk/20230805225107-qm1m2f5/20230805230218-aea8icj.sy @@ -5,7 +5,7 @@ "Properties": { "id": "20230805230218-aea8icj", "title": "搜索资源文件内容", - "updated": "20231025095306" + "updated": "20231025095556" }, "Children": [ { @@ -217,7 +217,7 @@ "ListData": {}, "Properties": { "id": "20230903112243-pwm33kc", - "updated": "20231025095306" + "updated": "20231025095556" }, "Children": [ { @@ -255,7 +255,8 @@ "Marker": "Kg==" }, "Properties": { - "id": "20231025095053-a0quwv1" + "id": "20231025095053-a0quwv1", + "updated": "20231025095556" }, "Children": [ { @@ -263,12 +264,12 @@ "Type": "NodeParagraph", "Properties": { "id": "20231025095053-ee3etgb", - "updated": "20231025095107" + "updated": "20231025095556" }, "Children": [ { "Type": "NodeText", - "Data": "不支持大于 64MB 或 1024 页的 PDF" + "Data": "不支持大于 128MB 或 1024 页的 PDF" } ] } diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20230805232636-zh0adz2/20230805232719-04mqbcx/20230805232920-5fdco36.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20230805232636-zh0adz2/20230805232719-04mqbcx/20230805232920-5fdco36.sy index c6a758149..a3c3a6dc5 100644 --- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20230805232636-zh0adz2/20230805232719-04mqbcx/20230805232920-5fdco36.sy +++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20230805232636-zh0adz2/20230805232719-04mqbcx/20230805232920-5fdco36.sy @@ -5,7 +5,7 @@ "Properties": { "id": "20230805232920-5fdco36", "title": "搜索資源文件內容", - "updated": "20231025095336" + "updated": "20231025095553" }, "Children": [ { @@ -220,7 +220,7 @@ "ListData": {}, "Properties": { "id": "20230903112449-mq7jbfe", - "updated": "20231025095336" + "updated": "20231025095553" }, "Children": [ { @@ -259,7 +259,7 @@ }, "Properties": { "id": "20231025095319-kupw6kw", - "updated": "20231025095323" + "updated": "20231025095553" }, "Children": [ { @@ -267,12 +267,12 @@ "Type": "NodeParagraph", "Properties": { "id": "20231025095319-egfy5yi", - "updated": "20231025095323" + "updated": "20231025095553" }, "Children": [ { "Type": "NodeText", - "Data": "不支援大於 64MB 或 1024 頁的 PDF" + "Data": "不支援大於 128MB 或 1024 頁的 PDF" } ] } diff --git a/kernel/model/asset_content.go b/kernel/model/asset_content.go index cfd356e02..1da770740 100644 --- a/kernel/model/asset_content.go +++ b/kernel/model/asset_content.go @@ -480,7 +480,7 @@ func NewAssetsSearcher() *AssetsSearcher { const ( TxtAssetContentMaxSize = 1024 * 1024 * 4 PDFAssetContentMaxPage = 1024 - PDFAssetContentMaxSize = 1024 * 1024 * 64 + PDFAssetContentMaxSize = 1024 * 1024 * 128 ) type AssetParseResult struct { @@ -830,7 +830,7 @@ func (parser *PdfAssetParser) Parse(absPath string) (ret *AssetParseResult) { } if PDFAssetContentMaxSize < len(pdfData) { - // PDF files larger than 64MB are not included in asset file content searching https://github.com/siyuan-note/siyuan/issues/9500 + // PDF files larger than 128MB are not included in asset file content searching https://github.com/siyuan-note/siyuan/issues/9500 logging.LogWarnf("ignore large PDF asset [%s] with [%s]", absPath, humanize.Bytes(uint64(len(pdfData)))) return }