# App Store onebox images are distorted

**URL:** <https://meta.discourse.org/t/app-store-onebox-images-are-distorted/74567>\
**Category:** Bug\
**Created:** [Novembro 22, 2017, 7:46am UTC](https://meta.discourse.org/t/app-store-onebox-images-are-distorted/74567 "2017-11-22T07:46:32Z")\
**Posts on this page:** 1\
**Showing post:** 10

<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:** [Novembro 23, 2017, 3:49am UTC](https://meta.discourse.org/t/app-store-onebox-images-are-distorted/74567/10 "2017-11-23T03:49:45Z")

</div>

Well that was a nightmare:

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/9/79a11dfc4426b1710932ff792b2dc74c41f82fa4.png)

This is fixed in latest due to this magic:

[https://github.com/discourse/discourse/commit/2fe131db9f0cc2e8f53a2d3334019466cd845968](https://github.com/discourse/discourse/commit/2fe131db9f0cc2e8f53a2d3334019466cd845968)

```css
 --magic-ratio: calc(var(--aspect-ratio) + 0.15);
 width: calc(128px * var(--magic-ratio));

```

If an image is tall we go and take the widest possible onebox image we allow which is 128px and then multiply it by aspect + 0.15.

This works cause now we have 2 widths set, the max-width and the explicit one.

Very very complicated to come up with this hack, it works fine 🛳

---

_[View the full topic](https://meta.discourse.org/t/app-store-onebox-images-are-distorted/74567)._
