Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么我的不起作用呢?上传后没看到有备份的图片,Image目录下面只有一个叫undefined的文件 #1

Closed
summer-ning opened this issue Mar 29, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@summer-ning
Copy link

No description provided.

@Redns
Copy link
Owner

Redns commented Mar 29, 2022

您好,能否将 picgo 配置文件 (路径为 C:\Users\{username}\AppData\Roaming\picgo\data.json)、日志文件 (路径为 C:\Users\{username}\AppData\Roaming\picgo\picgo.log) 贴出,感谢支持

@summer-ning
Copy link
Author

日志

2022-03-30 09:22:11 [PicGo INFO] Before transform 
2022-03-30 09:22:11 [PicGo INFO] Transforming... 
2022-03-30 09:22:11 [PicGo INFO] Before upload 
2022-03-30 09:22:11 [PicGo INFO] beforeUploadPlugins: renameFn running 
2022-03-30 09:22:11 [PicGo INFO] Uploading... 
2022-03-30 09:22:12 [PicGo INFO] afterUploadPlugins: autobackup running 
2022-03-30 09:22:12 [PicGo SUCCESS] 
https://gitee.com/xxxxx/xxxx/xxx/20220330092210.png 

autoback的配置

"autobackup": {
    "enable": true,
    "markFilePath": "",
    "imagePath": "Image",
    "backupLocation": "local"
  }

@Redns
Copy link
Owner

Redns commented Mar 30, 2022

您好,markFilePath不能为空,同时建议markFilePath和imagePath均使用绝对路径

@summer-ning
Copy link
Author

现在使用了绝对路径,还是不行,路径格式使用了linux的斜杠和windows的反斜杠都试了。而且日志跟之前的一样,没有看到任何错误

"autobackup": {
    "enable": true,
    "markFilePath": "D:/software/installation/office/picGo",
    "imagePath": "D:/software/installation/office/picGo/Image",
    "backupLocation": "local"
  }

@summer-ning
Copy link
Author

测试发现备份的图片在Image文件夹下面被命名为undefined,每次都是这个名字,会被覆盖,估计是读取文件名的时候出现了问题

@Redns
Copy link
Owner

Redns commented Mar 30, 2022

因为 picgo 实际上包含很多个组件 (类似于流水线处理),这个插件是位于最后的部件,初步判断可能是前面的部件 (比如 uploader) 上传完成后把图片内容删除了,所以这个插件获取不到数据

@summer-ning
Copy link
Author

图片在的,我用windows自带的看图工具打开undefined是能正常显示图片的

@summer-ning
Copy link
Author

找到问题了,代码有bug。filename的n要大写

fs.writeFile(imagePath + '/' + imgObject.filename, img, function(err){

还有这一行

markImage(markFilePath, imgList[i].fileName, imgList[i].filename, imgList[i].imgUrl, backupLocation)

@Redns
Copy link
Owner

Redns commented Mar 30, 2022

好的收到,我把 GUI 配置界面写完一并更新

@Redns
Copy link
Owner

Redns commented Mar 30, 2022

您好,该插件已更新至 v1.3.6,感谢您的反馈

@Redns Redns closed this as completed Mar 30, 2022
@Redns Redns added the bug Something isn't working label Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants