mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🐛 PDF files with too long file names cannot generate annotated images https://github.com/siyuan-note/siyuan/issues/15739 https://github.com/siyuan-note/siyuan/issues/10666
This commit is contained in:
parent
1e95b68df6
commit
cfb976eb89
7 changed files with 34 additions and 15 deletions
|
|
@ -201,7 +201,7 @@ func NetAssets2LocalAssets(rootID string, onlyImg bool, originalURL string) (err
|
|||
name := filepath.Base(u)
|
||||
name = util.FilterUploadFileName(name)
|
||||
name = "network-asset-" + name
|
||||
name = util.AssetName(name)
|
||||
name = util.AssetName(name, ast.NewNodeID())
|
||||
writePath := filepath.Join(assetsDirPath, name)
|
||||
if err = filelock.Copy(u, writePath); err != nil {
|
||||
logging.LogErrorf("copy [%s] to [%s] failed: %s", u, writePath, err)
|
||||
|
|
@ -303,7 +303,7 @@ func NetAssets2LocalAssets(rootID string, onlyImg bool, originalURL string) (err
|
|||
name += ext
|
||||
}
|
||||
}
|
||||
name = util.AssetName(name)
|
||||
name = util.AssetName(name, ast.NewNodeID())
|
||||
name = "network-asset-" + name
|
||||
writePath := filepath.Join(assetsDirPath, name)
|
||||
if err = filelock.WriteFile(writePath, data); err != nil {
|
||||
|
|
@ -737,7 +737,7 @@ func RenameAsset(oldPath, newName string) (newPath string, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
newName = util.AssetName(newName + filepath.Ext(oldPath))
|
||||
newName = util.AssetName(newName+filepath.Ext(oldPath), ast.NewNodeID())
|
||||
parentDir := path.Dir(oldPath)
|
||||
newPath = path.Join(parentDir, newName)
|
||||
oldAbsPath, getErr := GetAssetAbsPath(oldPath)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue