sb-sb / smms-api

SM.MS API Document
https://doc.sm.ms/
2 stars 0 forks source link

图片删除后的显示问题,建议显示alt-text #1

Open gMan1990 opened 3 years ago

gMan1990 commented 3 years ago

比如这张图,图已删除,本来应该显示有用的alt信息,但现在是一张默认404图片

![有用的alt信息](https://i.loli.net/2020/12/26/KEBAXzwRanMC3bg.png)

Showfom commented 3 years ago

为什么要显示有用的 alt 信息?已经在数据库里删除了,除了删除图片的 hash 值,不保留图片的其他信息

gMan1990 commented 3 years ago

@Showfom 你比如说![这是张皮卡丘图](https://i.loli.net/2020/12/26/KEBAXzwRanMC3bg.png),(图片已被删,你可以贴到其它地方看效果)

  1. 还是可以访问到,但显示为404样式图片(这样我看着网页显示完全不知道该图是什么东西
  2. 不能访问到,http status = 404 (这样网页会显示出alt值,那我就知道该图表达的是皮卡丘

这也是alt属性的本意 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-alt

Defines an alternative text description of the image.

Note: Browsers do not always display images. There are a number of situations in which a browser might not display images, such as: ... In these cases, the browser may replace the image with the text in the element's alt attribute. For these reasons and others, provide a useful value for alt whenever possible.

Showfom commented 3 years ago

你说的很有道理,建议接受,但是我们懒得改