mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-04 03:40:15 +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
|
|
@ -981,7 +981,7 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
|
|||
if "" == existName {
|
||||
name = filepath.Base(absolutePath)
|
||||
name = util.FilterUploadFileName(name)
|
||||
name = util.AssetName(name)
|
||||
name = util.AssetName(name, ast.NewNodeID())
|
||||
assetTargetPath := filepath.Join(assetDirPath, name)
|
||||
if err = filelock.Copy(absolutePath, assetTargetPath); err != nil {
|
||||
logging.LogErrorf("copy asset from [%s] to [%s] failed: %s", absolutePath, assetTargetPath, err)
|
||||
|
|
@ -1104,7 +1104,7 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
|
|||
if "" == existName {
|
||||
name = filepath.Base(absolutePath)
|
||||
name = util.FilterUploadFileName(name)
|
||||
name = util.AssetName(name)
|
||||
name = util.AssetName(name, ast.NewNodeID())
|
||||
assetTargetPath := filepath.Join(assetDirPath, name)
|
||||
if err = filelock.Copy(absolutePath, assetTargetPath); err != nil {
|
||||
logging.LogErrorf("copy asset from [%s] to [%s] failed: %s", absolutePath, assetTargetPath, err)
|
||||
|
|
@ -1249,7 +1249,7 @@ func processBase64Img(n *ast.Node, dest string, assetDirPath string) {
|
|||
name = alt.TokensStr() + ext
|
||||
}
|
||||
name = util.FilterUploadFileName(name)
|
||||
name = util.AssetName(name)
|
||||
name = util.AssetName(name, ast.NewNodeID())
|
||||
|
||||
tmp := filepath.Join(base64TmpDir, name)
|
||||
tmpFile, openErr := os.OpenFile(tmp, os.O_RDWR|os.O_CREATE, 0644)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue