# Eliminate YouTube thumbnail black bars

**URL:** <https://meta.discourse.org/t/eliminate-youtube-thumbnail-black-bars/319936>\
**Category:** Feature\
**Created:** [August 3, 2024, 5:37am UTC](https://meta.discourse.org/t/eliminate-youtube-thumbnail-black-bars/319936 "2024-08-03T05:37:22Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![jancernik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jancernik/32/275892_2.png) [@jancernik](https://meta.discourse.org/u/jancernik)\
**Post date:** [August 13, 2024, 12:39am UTC](https://meta.discourse.org/t/eliminate-youtube-thumbnail-black-bars/319936/4 "2024-08-13T00:39:24Z")

</div>

I think I understand what you mean now, but processing images on core does not really fit with our use case for them. We don’t store the thumbnails for these embeds, we fetch them directly from YouTube when we need them.

That being said, identifying which images should be cropped shouldn’t be that difficult. You can look at the URL for this:

`https://img.youtube.com/vi/dsVAzSG6SbM/hqdefault.jpg`

`maxresdefault`

- It’s always 16:9.
- It’s the highest resolution.
- Not always available.

`hqdefault`

- It’s always 4:3.
- If the original video is 16:9, it adds black bars.

`mqdefault`

- It’s always 16:9.
- It’s even lower resolution than `hqdefault`.

While a tad weird, they are predictable. My guess is that the 4:3 format is a legacy size they still use for the sake of compatibility.

For displaying 16:9 images, it’s as simple as fixing the aspect ratio. If you need other aspect ratios, I think you should be good passing a flag and compensating the scale with CSS.

It’s true that the composer preview can be improved, but this could be done with a similar approach as described above.

The only edge case I can see with this approach is with vertical videos with low-res thumbnails. In that case, the black bars are not shown. 🤷‍♂️

 ![](https://global.discourse-cdn.com/meta/original/4X/a/2/8/a28aab657ca980bd100a0615ff85de80ab497a8d.jpeg)

---

_[View the full topic](https://meta.discourse.org/t/eliminate-youtube-thumbnail-black-bars/319936)._
