Skip to content

关于自定义图片 | About Custom Images #11

@logchan

Description

@logchan

自定义图片和头像功能目前的做法是和整个聊天内容的信息一起保存在浏览器的 localStorage 里,这个存储的容量上限是所有东西加起来5MB左右。因此之前会遇到一些图片无法上传的问题。(注:“上传”也只是传到你的浏览器里面)

目前使用了一个临时方法:自动把上传的图片缩小到宽400px,头像宽100px。这样一来每张图片大约不到100k,应该还算够用……

要彻底解决这个问题需要把图片放到别的地方(比如 IndexedDB)不过会比较麻烦。我会先做完移动端适配再来考虑这个事。

The custom image / avatar uploading feature currently saves the images with other chat data in your browser's localStorage, which has a size limit of about 5MB for everything. Therefore, some have encountered issues with image uploading. (Note: here, uploading means transferring into the browser.)

A temporary solution has been implemented: the uploaded images are resized automatically to width of 400px (100px for avatars). Each image will take less than 100KB space, should be good for most users.

One better and permanent solution would be to use IndexedDB. But it'll take more time to implement, and I'd rather focus on mobile support first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions