# 在测试设置上恢复了备份——图像在帖子中不显示，除非我更改分辨率

**URL:** <https://meta.discourse.org/t/restored-a-backup-on-a-test-setup-image-doesnt-show-in-post-unless-i-change-resolution/274575>\
**Category:** Support\
**Created:** [2023年八月9日 23:13 UTC](https://meta.discourse.org/t/restored-a-backup-on-a-test-setup-image-doesnt-show-in-post-unless-i-change-resolution/274575 "2023-08-09T23:13:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![JJ\_IA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jj_ia/32/317035_2.png) [@JJ\_IA](https://meta.discourse.org/u/JJ_IA)\
**Post date:** [2023年八月9日 23:13 UTC](https://meta.discourse.org/t/restored-a-backup-on-a-test-setup-image-doesnt-show-in-post-unless-i-change-resolution/274575/1 "2023-08-09T23:13:46Z")

</div>

有点奇怪，但我恢复了一个备份，想在 Discourse 的测试环境中看看效果，其中一个帖子里的图片被设置为 50% 大小时，出现了下图所示的情况。我尝试了“重建 HTML”，但没有任何效果。奇怪的是，如果我将分辨率从 50% 改为其他任何值，它都能正常工作（例如 49%、51% 等），并且在帖子中显示得很好。我把 HTML 贴在下面了。编辑时图片预览看起来没问题，但就是加载不了？？太奇怪了。

`![image|400x500, 50%](upload://4WKdjbSdihW1G9uHJhVB9jJdzcy.jpeg)`

有什么想法吗？？谢谢！

 ![image](https://global.discourse-cdn.com/meta/original/4X/b/9/b/b9b92064072c4089bc4ed0d0dcc6949fe588493a.png)

---

<div class="post-metadata">

**Author:** ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)\
**Post date:** [2023年八月9日 23:21 UTC](https://meta.discourse.org/t/restored-a-backup-on-a-test-setup-image-doesnt-show-in-post-unless-i-change-resolution/274575/2 "2023-08-09T23:21:12Z")

</div>

您在恢复结束时看到以下消息了吗？

> 帖子将由 sidekiq 中的后台作业重新烘焙。在作业完成之前，您将看到丢失的图片。  
> 您可以通过手动运行“rake posts:rebake\_uncooked\_posts”来加快此过程。

---

<div class="post-metadata">

**Author:** ![JJ\_IA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jj_ia/32/317035_2.png) [@JJ\_IA](https://meta.discourse.org/u/JJ_IA)\
**Post date:** [2023年八月9日 23:23 UTC](https://meta.discourse.org/t/restored-a-backup-on-a-test-setup-image-doesnt-show-in-post-unless-i-change-resolution/274575/3 "2023-08-09T23:23:43Z")

</div>

> [@gerhard](#):
>
> rake posts:rebake\_uncooked\_posts

一定错过了那条消息——我进入了 web\_only 应用并尝试了 rake posts:rebake，但什么也没发生。我会尝试你发布的内容。谢谢！

---

<div class="post-metadata">

**Author:** ![JJ\_IA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jj_ia/32/317035_2.png) [@JJ\_IA](https://meta.discourse.org/u/JJ_IA)\
**Post date:** [2023年八月9日 23:35 UTC](https://meta.discourse.org/t/restored-a-backup-on-a-test-setup-image-doesnt-show-in-post-unless-i-change-resolution/274575/4 "2023-08-09T23:35:20Z")

</div>

好的，我尝试了手动过程，但它不起作用（显示“0 篇帖子完成！”）。我正在运行一个双容器设置，这会成为问题吗？

---

<div class="post-metadata">

**Author:** ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)\
**Post date:** [2023年八月9日 23:37 UTC](https://meta.discourse.org/t/restored-a-backup-on-a-test-setup-image-doesnt-show-in-post-unless-i-change-resolution/274575/5 "2023-08-09T23:37:49Z")

</div>

不，不应该。

您的上传是本地存储还是存储在 S3 上？您恢复的是仅 SQL 的备份（`.sql.gz`）还是包含上传的完整备份（`.tar.gz`）？

---

<div class="post-metadata">

**Author:** ![JJ\_IA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jj_ia/32/317035_2.png) [@JJ\_IA](https://meta.discourse.org/u/JJ_IA)\
**Post date:** [2023年八月9日 23:40 UTC](https://meta.discourse.org/t/restored-a-backup-on-a-test-setup-image-doesnt-show-in-post-unless-i-change-resolution/274575/6 "2023-08-09T23:40:00Z")

</div>

所有上传都存储在本地。

完整备份恢复（.tar.gz）。

为了说清楚——如果我点击图片，它会弹出，但除非我修改恢复时设置的分辨率，否则它不会在帖子中显示为嵌入式或其他形式。

谢谢。

---

<div class="post-metadata">

**Author:** ![JJ\_IA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jj_ia/32/317035_2.png) [@JJ\_IA](https://meta.discourse.org/u/JJ_IA)\
**Post date:** [2023年八月9日 23:49 UTC](https://meta.discourse.org/t/restored-a-backup-on-a-test-setup-image-doesnt-show-in-post-unless-i-change-resolution/274575/7 "2023-08-09T23:49:59Z")

</div>

在另一台机器上使用 Firefox 而不是 Chrome 试了一下，一切正常。Chrome 出现了一些奇怪的缓存问题，我通过这个方法解决了……

[清除 Chrome 中网站的缓存](https://support.google.com/chrome/thread/16531954/clear-cache-for-specific-website-in-google-chrome?hl=en)

感谢 @gerhard 的帮助！

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2023年九月8日 23:50 UTC](https://meta.discourse.org/t/restored-a-backup-on-a-test-setup-image-doesnt-show-in-post-unless-i-change-resolution/274575/8 "2023-09-08T23:50:43Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
