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

希望 Halo 支持附件缩略图功能 #2387

Closed
ruibaby opened this issue Sep 7, 2022 · 9 comments · Fixed by #6454
Closed

希望 Halo 支持附件缩略图功能 #2387

ruibaby opened this issue Sep 7, 2022 · 9 comments · Fixed by #6454
Assignees
Labels
area/console Issues or PRs related to the Halo Console area/core Issues or PRs related to the Halo Core kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Milestone

Comments

@ruibaby
Copy link
Member

ruibaby commented Sep 7, 2022

你当前使用的版本

next

描述一下此特性

目前 2.0 的附件如果是图片的话,仅有原图的访问地址(status.permalink),但目前会带来的问题是在后台展示或者选择图片的时候列表所加载的图片是原图,如果达到一定数量较大的原图,会导致页面卡顿。期望改进如下:

  1. 默认本地存储策略支持生成缩略图。
  2. status.permalink 改为 status.urls,其中 urls 包含一系列不同格式的图片。必须包含 rawthumbnail
  3. 外部存储策略如阿里云 OSS 支持设置 thumbnail 的图片处理规则名称,那么这时候 OSS 的 status.urls.thumbnail 就形如 https://foo.oss-cn-shenzhen.aliyuncs.com/bar.jpg?x-oss-process=style/thumbnail,其中 x-oss-process=style/thumbnail 即规则名称。

未来可考虑支持:

  1. 除了 thumbnail 必须设置之外,外部存储可设置多种图片处理规则,参考阿里云 OSS 的图片处理规则,可在需要使用的时候选择规则。
  2. 附件选择组件在选择图片的时候可以选择 status.urls 中的任意一个。
  3. 提供插件扩展点,插件可在上传的时候对图片做处理,生成类似 status.urls.webp 等图片类型。

附加信息

No response

@ruibaby
Copy link
Member Author

ruibaby commented Sep 7, 2022

/kind feature
/milestone 2.0
/area core
/area admin

@f2c-ci-robot f2c-ci-robot bot added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 7, 2022
@f2c-ci-robot f2c-ci-robot bot added this to the 2.0 milestone Sep 7, 2022
@f2c-ci-robot f2c-ci-robot bot added area/core Issues or PRs related to the Halo Core area/console Issues or PRs related to the Halo Console labels Sep 7, 2022
@ruibaby
Copy link
Member Author

ruibaby commented Sep 7, 2022

/assign @JohnNiang
/assign

@JohnNiang JohnNiang added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label Oct 13, 2022
@JohnNiang JohnNiang modified the milestones: 2.0.0, 2.0.x Dec 1, 2022
@JohnNiang JohnNiang modified the milestones: 2.0.x, Backlog Dec 16, 2022
f2c-ci-robot bot pushed a commit that referenced this issue Apr 24, 2023
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

#### What this PR does / why we need it:

为附件库的图片渲染添加硬件加速(GPU)的支持,可以改善在附件库包含大量大图时的操作体验,能够缓解卡顿的问题。不过最终还是需要 #2387 的支持。

测试(一共 60 张图片,合计 230m):

before:

<img width="766" alt="image" src="https://user-images.githubusercontent.com/21301288/233842635-3181df5d-fd26-44f1-aa30-314a3dba05a6.png">

after:

<img width="858" alt="image" src="https://user-images.githubusercontent.com/21301288/233842542-38a43b82-6452-4728-81ab-45f0cf528465.png">

#### Which issue(s) this PR fixes:

Fixes #3830 

#### Special notes for your reviewer:

测试方式:

1. 上传若干大图,对比修改前对附件库的操作,以及在文章中选择附件。

#### Does this PR introduce a user-facing change?

```release-note
优化 Console 端附件库的图片渲染性能。
```
@guqing guqing modified the milestones: Backlog, 2.19.x Aug 7, 2024
@guqing
Copy link
Member

guqing commented Aug 7, 2024

/assign

@wan92hen
Copy link
Collaborator

wan92hen commented Aug 7, 2024

听起来这个改动会有兼容性问题呢

@guqing
Copy link
Member

guqing commented Aug 7, 2024

听起来这个改动会有兼容性问题呢

稍后会有 RFC 被提上来在进行讨论,issue 的描述只是功能参考和需求

@guqing
Copy link
Member

guqing commented Aug 7, 2024

RFC 参考:halo-dev/rfcs#24

@guqing guqing changed the title 附件支持设置多种访问地址 希望 Halo 支持附件缩略图功能 Aug 8, 2024
@ruibaby
Copy link
Member Author

ruibaby commented Aug 8, 2024

@guqing 需不需要写一下文章内容中的图片处理,在 #缩略图使用 中只提到了主题开发的时候可以使用 srcset,但文章内容在主题中是无法干预的。

@ruibaby
Copy link
Member Author

ruibaby commented Aug 8, 2024

另外,这个可以直接提到 https://github.com/halo-dev/rfcs

@guqing
Copy link
Member

guqing commented Aug 9, 2024

@guqing 需不需要写一下文章内容中的图片处理,在 #缩略图使用 中只提到了主题开发的时候可以使用 srcset,但文章内容在主题中是无法干预的。

已经在最新的内容中补充:halo-dev/rfcs#24

@f2c-ci-robot f2c-ci-robot bot closed this as completed in ef37aa7 Aug 26, 2024
@JohnNiang JohnNiang modified the milestones: 2.19.x, 2.19.0 Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/console Issues or PRs related to the Halo Console area/core Issues or PRs related to the Halo Core kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants