# Changing image width/height manually does not always work!

**URL:** https://meta.discourse.org/t/changing-image-width-height-manually-does-not-always-work/86649
**Category:** Support
**Created:** [May 2, 2018, 7:40am UTC](https://meta.discourse.org/t/changing-image-width-height-manually-does-not-always-work/86649 "2018-05-02T07:40:25Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![ccstone](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ccstone/32/140215_2.png) [@ccstone](https://meta.discourse.org/u/ccstone)
#### Post date: [May 2, 2018, 7:40am UTC](https://meta.discourse.org/t/changing-image-width-height-manually-does-not-always-work/86649/1 "2018-05-02T07:40:25Z")

</div>

Hey Folks,

On this [page](https://forum.keyboardmaestro.com/t/trying-to-add-two-variables-and-update-one-of-them-what-am-i-doing-wrong/10221) of the Keyboard Maestro forum post #1 has a fairly insanely large image caused by the screenshot being taken on a retina Mac.

As one of the moderators of the forum I fix these when I come across them. I believe they are usually (perhaps always) PNG files.

The problem we have is that changing the image’s width/height doesn’t always work on the display page – even though the image is perfectly resized in the editor preview.

What might be causing this discrepancy, and what’s the best way to fix it?

Thanks.

–  
Best Regards,  
Chris

---

<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: [May 2, 2018, 11:47pm UTC](https://meta.discourse.org/t/changing-image-width-height-manually-does-not-always-work/86649/2 "2018-05-02T23:47:03Z")

</div>

Can you post examples please here so we can investigate?

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [May 3, 2018, 12:01am UTC](https://meta.discourse.org/t/changing-image-width-height-manually-does-not-always-work/86649/3 "2018-05-03T00:01:53Z")

</div>

If you mean the image in the topic you linked to

```plaintext
<img 
src="https://forum.keyboardmaestro.com/uploads/default/optimized/3X/2/7/27a90309b2f8e079db760d791744afa8b5cf4819_1_690x2000.png" 
width="690" height="2000">

```

and you changed the width and height values, have you also tried changing the src value? i.e.  
**27a90309b2f8e079db760d791744afa8b5cf4819\_1\_690x2000.png**  
notice the “690x2000” in the name.

---

<div class="post-metadata">

### Author: ![ccstone](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ccstone/32/140215_2.png) [@ccstone](https://meta.discourse.org/u/ccstone)
#### Post date: [May 4, 2018, 1:39am UTC](https://meta.discourse.org/t/changing-image-width-height-manually-does-not-always-work/86649/4 "2018-05-04T01:39:51Z")

</div>

> [@sam](#):
>
> Can you post examples

Hey Sam,

You bet.

[Original image](https://forum.keyboardmaestro.com/t/trying-to-add-two-variables-and-update-one-of-them-what-am-i-doing-wrong/10221) on the KM forum PNG – 1064 x 3212.

I’ve left all the test images on the page linked above for you to see.

Old format – fails to resize – but _does_ resize in the preview.

```plaintext
![image](upload://5EQJ6TVEnhgfxPjFOv8j7HLgAxX.png)

```

Old format – trying just the width attribute – fails to resize – but _does_ resize in the preview.

```plaintext
![image](upload://5EQJ6TVEnhgfxPjFOv8j7HLgAxX.png)

```

New format – default size after dragging and dropping into the editor:

```plaintext
![Keyboard Maestro Export|690x2000](upload://5EQJ6TVEnhgfxPjFOv8j7HLgAxX.png)

```

New format – fails to resize – but _does_ resize in the preview.

```plaintext
![Keyboard Maestro Export|517x1500](upload://5EQJ6TVEnhgfxPjFOv8j7HLgAxX.png)

```

Let me know if you need anything else.

-Chris

---

<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: [May 4, 2018, 1:40am UTC](https://meta.discourse.org/t/changing-image-width-height-manually-does-not-always-work/86649/5 "2018-05-04T01:40:56Z")

</div>

Sorry Chris, I meant can you upload the images here? I want to see the repro in our DB / uploads.

---

<div class="post-metadata">

### Author: ![ccstone](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ccstone/32/140215_2.png) [@ccstone](https://meta.discourse.org/u/ccstone)
#### Post date: [May 4, 2018, 5:20am UTC](https://meta.discourse.org/t/changing-image-width-height-manually-does-not-always-work/86649/6 "2018-05-04T05:20:46Z")

</div>

> [@sam](#):
>
> I meant can you upload the images here?

Hey Sam,

Sorry. I posted a link to the page they were on, so that didn’t occur to me.

Here you go.

-Chris

* * *

 ![27a90309b2f8e079db760d791744afa8b5cf4819](https://global.discourse-cdn.com/meta/original/3X/2/7/27a90309b2f8e079db760d791744afa8b5cf4819.png)

---

<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: [May 4, 2018, 5:29am UTC](https://meta.discourse.org/t/changing-image-width-height-manually-does-not-always-work/86649/7 "2018-05-04T05:29:00Z")

</div>

I see @zogstrip this is somehow related to the magic cropping stuff we have that ensures that we never have mega tall images in posts, right?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [May 4, 2018, 10:10am UTC](https://meta.discourse.org/t/changing-image-width-height-manually-does-not-always-work/86649/8 "2018-05-04T10:10:48Z")

</div>

> [@ccstone](#):
>
> The problem we have is that changing the image’s width/height doesn’t always work on the display page – even though the image is perfectly resized in the editor preview.

Yeah, there is a _slight_ discrepancy between the preview and the cooked image.

In the preview, we’ll always show the **original** image resized to fit the “`{max image width}x{max image height}`” (`690x500` by default) dimension.

In the cooked post, we’ll often show the **optimized** image which might get cropped if it’s [taller than 18:9](https://github.com/discourse/discourse/blob/07f4d16f32a79a4ae8fceb07c6f42e4f34f889f8/lib/cooked_post_processor.rb#L270-L272) (_latest phablets form factor_).

That’s what’s happening in your case. The image ratio is `3212 / 1064 = 3` which is taller than `18 / 9 = 2`.

---

<div class="post-metadata">

### Author: ![ccstone](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ccstone/32/140215_2.png) [@ccstone](https://meta.discourse.org/u/ccstone)
#### Post date: [May 5, 2018, 7:48am UTC](https://meta.discourse.org/t/changing-image-width-height-manually-does-not-always-work/86649/9 "2018-05-05T07:48:36Z")

</div>

> [@zogstrip](#):
>
> Yeah, there is a slight discrepancy between the preview and the cooked image.

Ah, I see.

I have an older 17" MacBook Pro with a 1920x1200 screen.

On my system the measured display size of the image on the Keyboard Maestro forum is approximately 662x1187 pixels. (Measured with a screen ruler app.)

So Peter must have change the default height of the “cooked” image. It is _much_ larger than what is showing here on the meta forum.

Unpleasantly large — thus my attempt to manually resize it. Take a look.

> **[Trying to add two variables and update one of them. What am I doing wrong?](https://forum.keyboardmaestro.com/t/trying-to-add-two-variables-and-update-one-of-them-what-am-i-doing-wrong/10221)**
>
> What is wrong with my action? I really only need to add the System Clipboard to a current variable, but couldn't figure that out so I converted it to a variable "Local\_Add", which also does not work. What's my error? Thanks. Keyboard Maestro 8.2...

> [@zogstrip](#):
>
> That’s what’s happening in your case. The image ratio is 3212 / 1064 = 3 which is taller than 18 / 9 = 2.

Are you saying this is the reason the “cooked” image _isn’t_ resized by changing the size in the markdown?

-Chris

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [May 15, 2019, 9:29pm UTC](https://meta.discourse.org/t/changing-image-width-height-manually-does-not-always-work/86649/11 "2019-05-15T21:29:02Z")

</div>

> [@ccstone](#):
>
> So Peter must have change the default height of the “cooked” image. It is _much_ larger than what is showing here on the meta forum.

Looks like they set “max\_image\_height” to 2000. Which explain why the cropped version is that tall.

---

<div class="post-metadata">

### Author: ![PackElend](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/packelend/32/95294_2.png) [@PackElend](https://meta.discourse.org/u/PackElend)
#### Post date: [August 26, 2019, 9:49pm UTC](https://meta.discourse.org/t/changing-image-width-height-manually-does-not-always-work/86649/12 "2019-08-26T21:49:59Z")

</div>

> [@ccstone](#):
>
> ![27a90309b2f8e079db760d791744afa8b5cf4819](https://global.discourse-cdn.com/meta/original/3X/2/7/27a90309b2f8e079db760d791744afa8b5cf4819.png)
> 
> 27a90309b2f8e079db760d791744afa8b5cf4819.png1064×3212 528 KB

what nice app is used here?

---

<div class="post-metadata">

### Author: ![ccstone](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ccstone/32/140215_2.png) [@ccstone](https://meta.discourse.org/u/ccstone)
#### Post date: [August 26, 2019, 10:39pm UTC](https://meta.discourse.org/t/changing-image-width-height-manually-does-not-always-work/86649/13 "2019-08-26T22:39:14Z")

</div>

> [@PackElend](#):
>
> what nice app is used here?

Hey @PackElend,

That’s [Keyboard Maestro](https://www.keyboardmaestro.com/main/) – the best-of-breed (IMO) Automation Utility for the Mac.

[https://forum.keyboardmaestro.com](https://forum.keyboardmaestro.com)

–  
Take Care,  
Chris

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [March 16, 2023, 1:03pm UTC](https://meta.discourse.org/t/changing-image-width-height-manually-does-not-always-work/86649/14 "2023-03-16T13:03:56Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [April 29, 2023, 1:39pm UTC](https://meta.discourse.org/t/changing-image-width-height-manually-does-not-always-work/86649/15 "2023-04-29T13:39:53Z")

</div>


