手动更改图像宽高并不总是有效!

Hey Folks,

On this page 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

Can you post examples please here so we can investigate?

If you mean the image in the topic you linked to

<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.

Hey Sam,

You bet.

Original image 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.

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

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

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

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

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

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

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

Let me know if you need anything else.

-Chris

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

Hey Sam,

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

Here you go.

-Chris


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?

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 (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.

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.

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

-Chris

Looks like they set “max_image_height” to 2000. Which explain why the cropped version is that tall.

这里用的是哪个好用的应用?

嘿 @PackElend,

这是 Keyboard Maestro —— 我个人认为 Mac 上最出色的自动化工具。

–
保重,
Chris