siyuan-note / siyuan

A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang.
https://b3log.org/siyuan
GNU Affero General Public License v3.0
17.4k stars 1.29k forks source link

Internet images cannot be exported #11231

Open allrobot opened 2 months ago

allrobot commented 2 months ago

当断网/网络拥堵时,md图片格式无法导出图片,报错查询资源失败

Is there an existing issue for this?

Can the issue be reproduced with the default theme (daylight/midnight)?

Could the issue be due to extensions?

Describe the problem

如题所示,图片点右键弹出的菜单的导出选项就报错,它似乎不是从diskCache本地缓存中导出的图片,而是远程请求下载图片?

报错: image

Expected result

网络拥堵,或断网,无法导出[image](https://xxx.png)已缓存的图片,图床是github:https://raw.githubusercontent.com/user/project/main/img/xxx.png

Screenshot or screen recording presentation

SiYuan_1dSRvBQB4v

Version environment

- Version: latest
- Operating System: win10 enterprise 21H2
- Browser (if used):No

Log file

siyuan.log

More information

No response

TCOTC commented 2 months ago

应该跟 #11222 算作同一个需求,即本地缓存网络图片(下载到本地,一定时间后清除),加载网络图片时优先从缓存文件中获取

88250 commented 2 months ago

@TCOTC 不是一个问题,这个 issue 的问题是 copyFile 实现只能针对本地 asset,无法处理网络链接。估计得改进为网络链接资源单独实现导出。

allrobot commented 2 months ago

@TCOTC 不是一个问题,这个 issue 的问题是 copyFile 实现只能针对本地 asset,无法处理网络链接。估计得改进为网络链接资源单独实现导出。

https://github.com/siyuan-note/siyuan/issues/11222 和本Issue是同一个需求的,都是针对对网络图片本地缓存的需求,diskCache等重启电脑就没了,打开笔记就无法加载md格式的图片,所以diskCache无法满足我们的需求

我们需要网络图片的本地缓存文件夹,不是assets文件夹……

88250 commented 2 months ago

网络图片只能考虑转换为本地 asset 才能实现不联网访问。

---Original--- From: @.> Date: Fri, May 3, 2024 14:09 PM To: @.>; Cc: @.**@.>; Subject: Re: [siyuan-note/siyuan] Internet images cannot be exported (Issue#11231)

@TCOTC 不是一个问题,这个 issue 的问题是 copyFile 实现只能针对本地 asset,无法处理网络链接。估计得改进为网络链接资源单独实现导出。

11222 和本Issue是同一个需求的,都是针对对网络图片本地缓存的需求,diskCache等重启电脑就没了,打开笔记就无法加载md格式的图片,所以diskCache无法满足我们的需求

我们需要网络图片的本地缓存文件夹,不是assets文件夹……

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were assigned.Message ID: @.***>