# 某些调整大小的图片没有Lightbox

**URL:** <https://meta.discourse.org/t/no-lightbox-for-some-resized-images/349411>\
**Category:** Bug\
**Tags:** lightbox\
**Created:** [2025年一月28日 16:08 UTC](https://meta.discourse.org/t/no-lightbox-for-some-resized-images/349411 "2025-01-28T16:08:06Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![packman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/packman/32/289322_2.png) [@packman](https://meta.discourse.org/u/packman)\
**Post date:** [2025年一月28日 16:08 UTC](https://meta.discourse.org/t/no-lightbox-for-some-resized-images/349411/1 "2025-01-28T16:08:06Z")

</div>

用户上传了两张相似的图片，一张尺寸为 1172x103 像素，另一张为 1180x82 像素。我的缩略图尺寸设置为 350x200，因此这两张图片都过大，分别被调整为 350x30 和 350x24 像素。查看帖子时，第一张图片可以灯箱化，但第二张不行。

我怀疑这可能与去年年底修复的一个 bug 有关……

> [@Image lightboxing does not respect manual resizing or \[grid\] tags](https://meta.discourse.org/t/image-lightboxing-does-not-respect-manual-resizing-or-grid-tags/312535):
>
> Priority/Severity: Low. Platform: Confirmed in Firefox 127.0 on Windows 10 and Chrome 125.0.6422.165 on Android 14. Description: See below. Reproducible steps: Upload an image with a resolution of 690×500 pixels or lower and either manually resize it (e.g. ![|336x456,x150](upload://uoNNF6SaHfaM6bRapNRZoeKQqjU.png)) or put it in a [grid] (e.g. [grid] ![|336x456](upload://uoNNF6SaHfaM6bRapNRZoeKQqjU.png) [/grid]). Expected behavior The way lightboxing works in Discourse is meant to work is, i…

其中有一条陈述，我认为是代码实现的……

- 它可能 **需要同时超过两个尺寸** ，而不仅仅是一个——我无法想象一个场景，你希望一张图片（在页面上）尺寸为 690x10 像素，但却能灯箱化。

我认为这个 bug 使得任何大于 100x100 像素的图片都强制灯箱化，所以我怀疑第二张图片没有灯箱化是因为它的初始高度小于 100 像素。然而，调整后的图片尺寸为 350x24 像素，太小以至于无法阅读上面的文字，而且没有灯箱可以查看原始图片。

---

_[View the full topic](https://meta.discourse.org/t/no-lightbox-for-some-resized-images/349411)._
