# Add setting to disable hotlinking of large image files

**URL:** https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909
**Category:** Feature
**Created:** [11.Август.2017 21:47:31 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909 "2017-08-11T21:47:31Z")
**Posts on this page:** 20
**Page:** 3

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [01.Сентябрь.2017 18:27:33 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/42 "2017-09-01T18:27:33Z")

</div>

Lets see:

[http://img0.joyreactor.cc/pics/post/%D0%B3%D0%B8%D1%84%D0%BA%D0%B8-superjail-%D0%BC%D1%83%D0%BB%D1%8C%D1%82%D1%81%D0%B5%D1%80%D0%B8%D0%B0%D0%BB-%D0%A1%D0%B2%D0%BE%D1%8F-%D0%B0%D1%82%D0%BC%D0%BE%D1%81%D1%84%D0%B5%D1%80%D0%B0-1886210.gif(image larger than 10 MB)](http://img0.joyreactor.cc/pics/post/%D0%B3%D0%B8%D1%84%D0%BA%D0%B8-superjail-%D0%BC%D1%83%D0%BB%D1%8C%D1%82%D1%81%D0%B5%D1%80%D0%B8%D0%B0%D0%BB-%D0%A1%D0%B2%D0%BE%D1%8F-%D0%B0%D1%82%D0%BC%D0%BE%D1%81%D1%84%D0%B5%D1%80%D0%B0-1886210.gif)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [01.Сентябрь.2017 18:45:54 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/43 "2017-09-01T18:45:54Z")

</div>

@vinothkannans the 1 on both sides is confusing

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [01.Сентябрь.2017 21:35:54 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/44 "2017-09-01T21:35:54Z")

</div>

Also there should be an `alt="image too large to display"` tooltip on that, for mouse-capable devices. That will need to be translated but we do this in a bunch of places already.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [02.Сентябрь.2017 13:47:52 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/45 "2017-09-02T13:47:52Z")

</div>

I linked large image placeholders to the original external image url. The above problem comes when that image is already linked. Then the html structure got broken since it have two links.

So what if the large image already linked. Should I skip by not linking again with original image url?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [02.Сентябрь.2017 23:59:27 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/46 "2017-09-02T23:59:27Z")

</div>

Also go with grey for both icons, not blue or black. This is more correct and more color scheme neutral.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [03.Сентябрь.2017 06:35:17 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/47 "2017-09-03T06:35:17Z")

</div>

Currently it is with default text color. Okay I will change it to gray.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [03.Сентябрь.2017 20:52:39 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/48 "2017-09-03T20:52:39Z")

</div>

Hmm how is blue the default text color? Do you mean default _link_ color?

 ![image](https://global.discourse-cdn.com/meta/original/3X/6/3/636f64a4abca8340019fed817146675e4e6c9b04.png)

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [03.Сентябрь.2017 21:59:27 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/49 "2017-09-03T21:59:27Z")

</div>

Yeah, it is pulling it from the `a` and `a:visited` rules.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [04.Сентябрь.2017 08:39:50 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/50 "2017-09-04T08:39:50Z")

</div>

> [@codinghorror](#):
>
> Do you mean default link color?

Yes. Since it is font icon colors automatically comes from text colors.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [13.Сентябрь.2017 07:20:02 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/51 "2017-09-13T07:20:02Z")

</div>

> [@Very large gifs should be shown as previews](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/36):
>
> @vinothkannans does the tooltip work now so I can mouse over this kind of random looking generic image placeholder and get a plain English explanation of what happened?

> [@codinghorror](#):
>
> Also go with grey for both icons

I will do both of it on new PR. Also I am waiting for a solution to below problem. Can you @codinghorror or @sam suggess me any way to handle this situation.

> [@vinothkannans](#):
>
> I linked large image placeholders to the original external image url. What if the large image is already linked. Should I skip linking with original image url?

If skipped then user can’t see the image at all.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [13.Сентябрь.2017 07:52:05 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/52 "2017-09-13T07:52:05Z")

</div>

I am not following what you are asking here. I would like the tooltip and color changes to go in ASAP.

---

<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: [13.Сентябрь.2017 07:59:07 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/53 "2017-09-13T07:59:07Z")

</div>

> [@vinothkannans](#):
>
> I linked large image placeholders to the original external image url. What if the large image is already linked. Should I skip linking with original image url?

> [@vinothkannans](#):
>
> If skipped then user can’t see the image at all.

Would it be possible to skip the linking only if the image is already linked?  
But thinking about it, is it even possible to hotlink an image and add a link to it?  
I don’t think it’s possible with Markdown, or is it? Maybe HTML works?

[http://img0.joyreactor.cc/pics/post/%D0%B3%D0%B8%D1%84%D0%BA%D0%B8-superjail-%D0%BC%D1%83%D0%BB%D1%8C%D1%82%D1%81%D0%B5%D1%80%D0%B8%D0%B0%D0%BB-%D0%A1%D0%B2%D0%BE%D1%8F-%D0%B0%D1%82%D0%BC%D0%BE%D1%81%D1%84%D0%B5%D1%80%D0%B0-1886210.gif](http://img0.joyreactor.cc/pics/post/%D0%B3%D0%B8%D1%84%D0%BA%D0%B8-superjail-%D0%BC%D1%83%D0%BB%D1%8C%D1%82%D1%81%D0%B5%D1%80%D0%B8%D0%B0%D0%BB-%D0%A1%D0%B2%D0%BE%D1%8F-%D0%B0%D1%82%D0%BC%D0%BE%D1%81%D1%84%D0%B5%D1%80%D0%B0-1886210.gif)

No, it doesn’t. Could you show me an example where this is an actual problem?

So, I’d say, just make sure that there is only one link to the image in the cooked post and that is has the `rel="noflooow noopener"` set.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [13.Сентябрь.2017 08:09:17 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/54 "2017-09-13T08:09:17Z")

</div>

Okay. I will do both of it ASAP.

The problem I am trying to explain is

Let’s say `example.com/image.jpg` is larger image than allowed size.

```plaintext
<img src="http://example.com/image.jpg">

```

Above RAW will be cooked as

```plaintext
<a href="http://example.com/image.jpg">
  <span class="large-image fa fa-picture-o"></span>
</a>

```

Now the problem comes when the image already linked in RAW like below

```plaintext
<a href="http://google.com">
  <img src="http://example.com/image.jpg">
</a>

```

Example:

[http://google.com](http://google.com)[http://img0.joyreactor.cc/pics/post/%25D0%25B3%25D0%25B8%25D1%2584%25D0%25BA%25D0%25B8-superjail-%25D0%25BC%25D1%2583%25D0%25BB%25D1%258C%25D1%2582%25D1%2581%25D0%25B5%25D1%2580%25D0%25B8%25D0%25B0%25D0%25BB-%25D0%25A1%25D0%25B2%25D0%25BE%25D1%258F-%25D0%25B0%25D1%2582%25D0%25BC%25D0%25BE%25D1%2581%25D1%2584%25D0%25B5%25D1%2580%25D0%25B0-1886210.gif(image larger than 10 MB)](http://img0.joyreactor.cc/pics/post/%25D0%25B3%25D0%25B8%25D1%2584%25D0%25BA%25D0%25B8-superjail-%25D0%25BC%25D1%2583%25D0%25BB%25D1%258C%25D1%2582%25D1%2581%25D0%25B5%25D1%2580%25D0%25B8%25D0%25B0%25D0%25BB-%25D0%25A1%25D0%25B2%25D0%25BE%25D1%258F-%25D0%25B0%25D1%2582%25D0%25BC%25D0%25BE%25D1%2581%25D1%2584%25D0%25B5%25D1%2580%25D0%25B0-1886210.gif)

I linked above image to `google.com`.

> [@gerhard](#):
>
> I don’t think it’s possible with Markdown, or is it? Maybe HTML works?

Yes. It is possible when we cooking it as HTML.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [13.Сентябрь.2017 08:20:49 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/55 "2017-09-13T08:20:49Z")

</div>

Now the above example image is changed as

```plaintext
<a href="http://google.com" rel="nofollow noopener"></a>
<a href="EXAMPLE_URL" target="_blank">
  <span class="large-image fa fa-picture-o"></span>
</a>

```

---

<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: [13.Сентябрь.2017 08:23:13 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/56 "2017-09-13T08:23:13Z")

</div>

Would it be possible to change

```plaintext
<a href="http://google.com">
  <img src="http://example.com/image.jpg">
</a>

```

into this?

```plaintext
<a href="http://google.com" rel="nofollow noopener">http://google.com</a>
<a href="http://example.com/image.jpg" rel="nofollow noopener" target="_blank">
  <span class="large-image fa fa-picture-o"></span>
</a>

```

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [13.Сентябрь.2017 08:28:56 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/57 "2017-09-13T08:28:56Z")

</div>

Yes. It is possible to cook the HTML like your example.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [08.Март.2018 22:25:58 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/61 "2018-03-08T22:25:58Z")

</div>

I believe this is mostly complete because large images don’t embed, and show a warning now courtesy of @vinothkannans – what do you think @sam?

(the following is a 5.26mb, 3264×2448 image)

[https://edmullen.net/test/rc.jpg(image larger than 10 MB)](https://edmullen.net/test/rc.jpg)

---

<div class="post-metadata">

### Author: ![Nathan\_Dean](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathan_dean/32/120260_2.png) [@Nathan\_Dean](https://meta.discourse.org/u/Nathan_Dean)
#### Post date: [08.Март.2018 23:13:40 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/62 "2018-03-08T23:13:40Z")

</div>

I am still seeing an undesired behavior.

Create a post with the only content being: “[Imgur: The magic of the Internet](https://i.imgur.com/u01fq8I.gif)”

Expected behavior:

- Image has no thumbnail and just displays as a text link, or the image is served from an https URL.

Actual behavior:

- Mixed content warning from Chrome and the padlock icon disappears for the page  
 ![image](https://global.discourse-cdn.com/meta/original/3X/9/b/9b0d2fdf23f4fac44c9994bd1d5ff7cfaf40ed47.png)

---

<div class="post-metadata">

### Author: ![Nathan\_Dean](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathan_dean/32/120260_2.png) [@Nathan\_Dean](https://meta.discourse.org/u/Nathan_Dean)
#### Post date: [08.Март.2018 23:16:37 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/63 "2018-03-08T23:16:37Z")

</div>

Hold on, it actually does the correct behavior, but only after page refresh.

![image](https://global.discourse-cdn.com/meta/original/3X/b/8/b8f5f65099f91b0fd9def4b7902f289a9a9beae8.png)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [08.Март.2018 23:17:09 UTC](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909/64 "2018-03-08T23:17:09Z")

</div>

Why would you explicitly link to the http version when the https version also works? I feel like this is a totally different request unrelated to what we implemented.

Yes this is working, going to close this as complete.

[Предыдущая страница](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909.md?page=2)

[Следующая страница](https://meta.discourse.org/t/add-setting-to-disable-hotlinking-of-large-image-files/67909.md?page=4)
