# How to process image links

**URL:** <https://discuss.dev.twitch.com/t/how-to-process-image-links/23139>\
**Category:** API\
**Created:** [November 15, 2019, 3:38am UTC](https://discuss.dev.twitch.com/t/how-to-process-image-links/23139 "2019-11-15T03:38:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![DevUser](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/devuser/32/7344_2.png) [@DevUser](https://discuss.dev.twitch.com/u/DevUser)\
**Post date:** [November 15, 2019, 3:38am UTC](https://discuss.dev.twitch.com/t/how-to-process-image-links/23139/1 "2019-11-15T03:38:07Z")

</div>

How do we process image links to set the width and height of the image with the correct aspect ratio?

```auto
https://static-cdn.jtvnw.net/previews-ttv/live_user_lirik-{width}x{height}.jpg

```

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [November 15, 2019, 11:48am UTC](https://discuss.dev.twitch.com/t/how-to-process-image-links/23139/2 "2019-11-15T11:48:06Z")

</div>

You can set it to whatever you want.

![](https://d2opxh93rbxzdn.cloudfront.net/original/2X/e/eafde42d5c937f324e5dcb8f8b5cdd0cb95cfef3.jpeg)

uses 1:1 1/3

---

<div class="post-metadata">

**Author:** ![DevUser](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/devuser/32/7344_2.png) [@DevUser](https://discuss.dev.twitch.com/u/DevUser)\
**Post date:** [November 16, 2019, 4:40pm UTC](https://discuss.dev.twitch.com/t/how-to-process-image-links/23139/3 "2019-11-16T16:40:16Z")

</div>

Yes, but how do I know what the aspect ratio is? Do I have to hardcode this? Different image links have different ratios too. For game images they are portrait but for stream images they are landscape.

This part of the new API doesn’t seem well thought out.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [November 16, 2019, 4:43pm UTC](https://discuss.dev.twitch.com/t/how-to-process-image-links/23139/4 "2019-11-16T16:43:44Z")

</div>

The aspect ratio is width:height 1:1.3

> [https://static-cdn.jtvnw.net/ttv-boxart/Star%20Wars%20Jedi%3A%20Fallen%20Order-83x113.jpg](https://static-cdn.jtvnw.net/ttv-boxart/Star%20Wars%20Jedi%3A%20Fallen%20Order-83x113.jpg)

113/83 = 1.36

To math for stream previews just do the same. Divide what twitch users

---

<div class="post-metadata">

**Author:** ![DevUser](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/devuser/32/7344_2.png) [@DevUser](https://discuss.dev.twitch.com/u/DevUser)\
**Post date:** [November 16, 2019, 4:44pm UTC](https://discuss.dev.twitch.com/t/how-to-process-image-links/23139/5 "2019-11-16T16:44:32Z")

</div>

Ok, what is it for stream images?  
[https://static-cdn.jtvnw.net/previews-ttv/live\_user\_solaryfortnite-{width}x{height}.jpg](https://static-cdn.jtvnw.net/previews-ttv/live_user_solaryfortnite-%7Bwidth%7Dx%7Bheight%7D.jpg)

Is this information documented somewhere or is this left up to self-discovery?

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [November 16, 2019, 4:46pm UTC](https://discuss.dev.twitch.com/t/how-to-process-image-links/23139/6 "2019-11-16T16:46:45Z")

</div>

![](https://d2opxh93rbxzdn.cloudfront.net/original/2X/1/1254240677cb1b29a6ebf01ca61a2352810cb1a2.jpeg)

Is

> [https://static-cdn.jtvnw.net/previews-ttv/live\_user\_cohhcarnage-440x248.jpg](https://static-cdn.jtvnw.net/previews-ttv/live_user_cohhcarnage-440x248.jpg)

440/248 = 1.77

> [@DevUser](#):
>
> Is this information documented somewhere or is this left up to self-discovery?

Self Disco.

I misread your post and give game art information.

But 1920x1080 will work for stream thumbs. Since thats what people stream at

> [https://static-cdn.jtvnw.net/previews-ttv/live\_user\_cohhcarnage-1920x1080.jpg](https://static-cdn.jtvnw.net/previews-ttv/live_user_cohhcarnage-1920x1080.jpg)

ratio 1.7777777\*

---

<div class="post-metadata">

**Author:** ![DevUser](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/devuser/32/7344_2.png) [@DevUser](https://discuss.dev.twitch.com/u/DevUser)\
**Post date:** [November 17, 2019, 9:04pm UTC](https://discuss.dev.twitch.com/t/how-to-process-image-links/23139/7 "2019-11-17T21:04:04Z")

</div>

Ok, this should have more documentation or at least another field in the response to let you know how to do the calculation for the image link.

It could also give you the width and height of the source image. You can get it like this without providing a width or height.

 ![](https://d2opxh93rbxzdn.cloudfront.net/original/2X/6/655f4f32ab85d74f3e65e5a8774e2828384e0ac4.jpeg)

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [December 17, 2019, 9:04pm UTC](https://discuss.dev.twitch.com/t/how-to-process-image-links/23139/8 "2019-12-17T21:04:06Z")

</div>

Closed on December 17, 2019, 9:04pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
