Changing image width/height manually does not always work!


(Christopher Stone) #1

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


Image upload max size and further resizing regression issue
(Sam Saffron) #2

Can you post examples please here so we can investigate?


(Mittineague) #3

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.


(Christopher Stone) #4

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.

<img src="/uploads/default/original/3X/2/7/27a90309b2f8e079db760d791744afa8b5cf4819.png" width="500" height="1509">

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

<img src="/uploads/default/original/3X/2/7/27a90309b2f8e079db760d791744afa8b5cf4819.png" width="500">

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


(Sam Saffron) #5

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


(Christopher Stone) #6

Hey Sam,

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

Here you go.

-Chris



(Sam Saffron) #7

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?


(Régis Hanol) #8

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.


(Christopher Stone) #9

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