mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
⚡ Improve the image loading performance in the database https://github.com/siyuan-note/siyuan/issues/15245
This commit is contained in:
parent
9bb91c3a97
commit
c852f6f51a
8 changed files with 113 additions and 8 deletions
|
|
@ -300,6 +300,12 @@ func IsSubPath(absPath, toCheckPath string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func IsCompressibleAssetImage(p string) bool {
|
||||
lowerName := strings.ToLower(p)
|
||||
return strings.HasPrefix(lowerName, "assets/") &&
|
||||
(strings.HasSuffix(lowerName, ".png") || strings.HasSuffix(lowerName, ".jpg") || strings.HasSuffix(lowerName, ".jpeg"))
|
||||
}
|
||||
|
||||
func SizeOfDirectory(path string) (size int64, err error) {
|
||||
err = filelock.Walk(path, func(path string, d fs.DirEntry, err error) error {
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue