# 不正な設定のサイトからの壊れたonebox画像の処理

**URL:** <https://meta.discourse.org/t/handling-of-broken-onebox-images-from-malconfigured-sites/199079>\
**Category:** Feature\
**Created:** [2021 年 8 月 3 日午後 9:20 UTC](https://meta.discourse.org/t/handling-of-broken-onebox-images-from-malconfigured-sites/199079 "2021-08-03T21:20:51Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![TallTrees](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/talltrees/32/208620_2.png) [@TallTrees](https://meta.discourse.org/u/TallTrees)\
**Post date:** [2021 年 8 月 3 日午後 9:20 UTC](https://meta.discourse.org/t/handling-of-broken-onebox-images-from-malconfigured-sites/199079/1 "2021-08-03T21:20:51Z")

</div>

「ホットリンク」をブロックするさまざまな手法を採用しているが、埋め込みデータ（メタデータなど）には画像のリンクをそのまま返している、設定が不適切なサイトをかなり多く見かけます。

> **[Pavilion hire - Horniman Museum and Gardens](https://www.horniman.ac.uk/space/pavilion-hire/)**
>
> Our bright and airy Pavilion is a contemporary venue which includes a large outside terrace overlooking the Gardens.

> **[Facilities for Hire](http://www.foresthillmethodistchurch.org/facilities-for-hire-lettings-policy/)**
>
> Forest Hill Methodist Church and Centre

[http://debug.iframely.com/](http://debug.iframely.com/) で確認したところ、これは Discourse 自体の問題というよりは、見た目が悪くなっているように思えます。

一つのアイデアとして、投稿を調理（cooking）する際にワンボックス生成が画像を取得し、後で提供するためのサムネイルを保存するか、取得できない場合は画像が指定されていないかのように振る舞う方法があります。

画像のコピーを保存すれば、かなり堅牢で将来にも対応でき、著作権の観点からも「フェアユース」の範囲内だと考えられます（元のサイトは、メタデータから取得した 130x90 のサムネイルを再利用しても不利益を被ることはないはずです。ただし、私は法律の専門家ではありません）。

それが不可能な場合、画像のエラーイベントをキャッチして、画像またはそのラッパーに `display:none` クラスを追加するコンポーネントを作成しようと試みました。しかし、`decorateCookedElement()` で行き詰まってしまい、まだ成功していません。私が探している場所が正しいのかどうかもわかりません。

ワンボックス内で画像が壊れて表示されることに頻繁に悩まされているのは私だけでしょうか？回避策を持っている人はいますか？

---

_[View the full topic](https://meta.discourse.org/t/handling-of-broken-onebox-images-from-malconfigured-sites/199079)._
