mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 PDF files larger than 64MB are not included in asset file content searching https://github.com/siyuan-note/siyuan/issues/9500
This commit is contained in:
parent
b64dfdd224
commit
17b598b033
1 changed files with 7 additions and 0 deletions
|
|
@ -480,6 +480,7 @@ func NewAssetsSearcher() *AssetsSearcher {
|
||||||
const (
|
const (
|
||||||
TxtAssetContentMaxSize = 1024 * 1024 * 4
|
TxtAssetContentMaxSize = 1024 * 1024 * 4
|
||||||
PDFAssetContentMaxPage = 1024
|
PDFAssetContentMaxPage = 1024
|
||||||
|
PDFAssetContentMaxSize = 1024 * 1024 * 64
|
||||||
)
|
)
|
||||||
|
|
||||||
type AssetParseResult struct {
|
type AssetParseResult struct {
|
||||||
|
|
@ -828,6 +829,12 @@ func (parser *PdfAssetParser) Parse(absPath string) (ret *AssetParseResult) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
logging.LogWarnf("ignore large PDF asset [%s] with [%s]", absPath, humanize.Bytes(uint64(len(pdfData))))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// next setup worker pool for processing PDF pages
|
// next setup worker pool for processing PDF pages
|
||||||
pages := make(chan *pdfPage, pc.PageCount)
|
pages := make(chan *pdfPage, pc.PageCount)
|
||||||
results := make(chan *pdfTextResult, pc.PageCount)
|
results := make(chan *pdfTextResult, pc.PageCount)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue