Oneboxing Large Images Fails with No Visual Cue
A bug has been reported where large images fail to onebox and do not display in Discourse posts. The issue has been observed on multiple sites, including try.discourse.org and meta.discourse.org. The problem is not related to image size limits, as the affected images are within the allowed size range.
The bug is characterized by the image appearing briefly in the composer window, but then disappearing from the baked post. The image link remains, but the image itself does not display.
Investigation has revealed that the issue is related to the download remote images to local setting. When this setting is enabled, Discourse attempts to download the remote image and display it locally. However, if the image is too large, it is removed from the post without any visual cue.
A fix has been proposed and merged into the Discourse codebase. The fix addresses a bug in the onebox handling of images, where only one type of onebox was handled correctly. The fix will display a placeholder with text saying the image is too large, instead of removing it entirely.
The bug is believed to have been present since the introduction of the download remote images to local setting, and is not a regression.
Notable Posts:
- Richie reported the issue and provided examples of affected images.
- Arkshine investigated the issue and provided insight into the Discourse codebase.
- Canapin demonstrated the issue and provided a screen recording of the problem.
- nbianca proposed and merged the fix into the Discourse codebase.
Outcome:
The fix has been merged and will resolve the issue on affected sites. The fix will display a placeholder with text saying the image is too large, instead of removing it entirely.