|
@@ -508,7 +508,7 @@ func (parser *TxtAssetParser) Parse(absPath string) (ret *AssetParseResult) {
|
|
|
}
|
|
|
|
|
|
if TxtAssetContentMaxSize < info.Size() {
|
|
|
- logging.LogWarnf("text asset [%s] is too large [%s]", absPath, humanize.Bytes(uint64(info.Size())))
|
|
|
+ logging.LogWarnf("text asset [%s] is too large [%s]", absPath, humanize.BytesCustomCeil(uint64(info.Size()), 2))
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -836,16 +836,16 @@ func (parser *PdfAssetParser) Parse(absPath string) (ret *AssetParseResult) {
|
|
|
if maxSize, parseErr := strconv.ParseUint(maxSizeVal, 10, 64); nil == parseErr {
|
|
|
if maxSize != PDFAssetContentMaxSize {
|
|
|
PDFAssetContentMaxSize = maxSize
|
|
|
- logging.LogInfof("set PDF asset content index max size to [%s]", humanize.Bytes(maxSize))
|
|
|
+ logging.LogInfof("set PDF asset content index max size to [%s]", humanize.BytesCustomCeil(maxSize, 2))
|
|
|
}
|
|
|
} else {
|
|
|
- logging.LogWarnf("invalid env [SIYUAN_PDF_ASSET_CONTENT_INDEX_MAX_SIZE]: [%s], parsing failed: ", maxSizeVal, parseErr)
|
|
|
+ logging.LogWarnf("invalid env [SIYUAN_PDF_ASSET_CONTENT_INDEX_MAX_SIZE]: [%s], parsing failed: %s", maxSizeVal, parseErr)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if PDFAssetContentMaxSize < uint64(len(pdfData)) {
|
|
|
// 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))))
|
|
|
+ logging.LogWarnf("ignore large PDF asset [%s] with [%s]", absPath, humanize.BytesCustomCeil(uint64(len(pdfData)), 2))
|
|
|
return
|
|
|
}
|
|
|
|