Markdown für Bildgröße in px, nicht in Prozent

Quick image resizing and markdown image dimensions talked about the new “Ninja :crossed_swords: feature” to add ,25% for image scaling.

That’s great, if you know the percentage that results in the px you want, and if you have consistently sized or few embedded images.

It’s not so great if you have a number of images of somewhat varying original size and you want them all to scale to (for instance) 250px width.

Changing a number of such images from markdown to HTML markup is also painful.

Any chance this Ninja feature could be enhanced to accept % or px specifications for the scaling?

1 „Gefällt mir“

That is already supported:

![very good|25x19](//assets-meta-cdck-prod-meta.s3.dualstack.us-west-1.amazonaws.com/original/3X/0/3/03741c9f3eafd7fc8ccd791a6971a2c0d52783e4.jpg)

produces

very good

while

![very good|250x190](//assets-meta-cdck-prod-meta.s3.dualstack.us-west-1.amazonaws.com/original/3X/0/3/03741c9f3eafd7fc8ccd791a6971a2c0d52783e4.jpg)

produces

very good

7 „Gefällt mir“

You can’t just specify the width though.

4 „Gefällt mir“

I had misunderstood the meaning of the |250x190]. I thought that was meant to convey the size of the original, not that it was meant as a scaling.

(Is there one place to look to find documentation of all Markdown-for-Discourse?)

But yes, my wish here is to specify the width to scale to, and have the height be scaled proportionally.

3 „Gefällt mir“

I am pretty warm to adding support for:

|250x] and |x190] in fact I like this little bit of ninja so much that I will get the change slotted. @pmusaraj can you add this support?

14 „Gefällt mir“

This is now done and in tests-passed.

10 „Gefällt mir“

:thinking: I am having a bit of trouble with this…

![image|100x](upload://dHF5P9JKjZN0gahVLRQmDIEqo8C.jpeg)
image|100x

![image|x100](upload://dHF5P9JKjZN0gahVLRQmDIEqo8C.jpeg)
image|x100

1 „Gefällt mir“

Not performant! :rofl:

4 „Gefällt mir“

Hmm, this is set up to respond to this syntax ![image|354x356,100x](upload://dHF5P9JKjZN0gahVLRQmDIEqo8C.jpeg) works:

image

I kept this consistent with percentage scaling, which responds to [image|300x100,50%].

1 „Gefällt mir“

The percentage scaling ninja markup no longer makes mental sense to me.

[image|300x100,50%] says “show this image (actual size unknown), at 300px by 100px, but wait, scale that by 50%, so show it at 150px by 50px”.

I really don’t understand the point of this kind of notation – because you can just set the pixel sizing however you want it, so why not do the 50% scaling in the first place?

I do not want to specify one display size followed by a second display size, and cannot imagine why anyone would. I just want to say “show this image (of unknown original size) at 150px width, with proportionally scaled height” or “show this image (of unknown original size) at 150px height, with proportionally scaled width”.

2 „Gefällt mir“

die gleiche Frage, die ich habe: Sag mir einfach, dass das Bild 200px breit ist, und überspringe die Höhe.

Ich hätte das auch gerne.

Zur Erinnerung: Die aktuelle Syntax zum Skalieren von Bildern (mit Leerzeichen zur besseren Lesbarkeit) sieht so aus:

![BILD_NAME | BREITExHÖHE, SKALIERUNGSPROZENTSATZ](BILD_ORT)

Ich finde es wäre wirklich toll, wenn wir NUR die Breite ODER die Höhe skalieren könnten und für die jeweilige Dimension das Wort AUTO eingeben könnten.

Zum Beispiel: Angenommen, ich möchte, dass dieses Bild 150 px breit ist, aber ich möchte das Seitenverhältnis nicht berechnen, um die Höhe an die richtige Auflösung anzupassen…
![sehr gut|250x190](//assets-meta-cdck-prod-meta.s3.dualstack.us-west-1.amazonaws.com/original/3X/0/3/03741c9f3eafd7fc8ccd791a6971a2c0d52783e4.jpg)

Es wäre großartig, wenn wir die BREITE durch 150 und die HÖHE durch auto ersetzen könnten, wie folgt…
![sehr gut|150xauto](//assets-meta-cdck-prod-meta.s3.dualstack.us-west-1.amazonaws.com/original/3X/0/3/03741c9f3eafd7fc8ccd791a6971a2c0d52783e4.jpg)

Was denkst du, @Falco?

Ich finde immer noch, dass der ursprüngliche Vorschlag etwas leichter zu erklären ist.

Einfügen:

![image|494x500](upload://jRgaIl6YH5la4m5rkLnkJIa6XYV.jpeg) 

Dann bearbeiten zu:

![image|100x](upload://jRgaIl6YH5la4m5rkLnkJIa6XYV.jpeg) 

Es funktioniert jetzt zwar laut diesem Beispiel, ist aber etwas schwieriger zu erklären:

![image|494x500,100x](upload://jRgaIl6YH5la4m5rkLnkJIa6XYV.jpeg) 

@jord8on das funktioniert bereits alles, dies ist die Syntax, die du suchst:

[sehr gut|250x190,150x]

4 „Gefällt mir“

Ahhhhh @sam, danke für die Umleitung. Die aktuelle Funktionalität ist PERFEKT, wenn ich das jetzt richtig verstehe.

Mal sehen, ob ich das richtig verstanden habe…

  • „x
9 „Gefällt mir“