TallTed
(Ted Thibodeau Jr)
6 Febbraio 2019, 5:00pm
1
Quick image resizing and markdown image dimensions talked about the new “Ninja 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 Mi Piace
Falco
(Falco)
6 Febbraio 2019, 5:36pm
2
That is already supported:

produces
while

produces
7 Mi Piace
You can’t just specify the width though.
4 Mi Piace
TallTed
(Ted Thibodeau Jr)
6 Febbraio 2019, 6:04pm
4
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 Mi Piace
sam
(Sam Saffron)
6 Febbraio 2019, 11:27pm
5
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 Mi Piace
pmusaraj
(Penar Musaraj)
8 Febbraio 2019, 1:40pm
7
This is now done and in tests-passed.
10 Mi Piace
sam
(Sam Saffron)
21 Febbraio 2019, 4:40am
9
I am having a bit of trouble with this…


1 Mi Piace
pmusaraj
(Penar Musaraj)
21 Febbraio 2019, 1:42pm
13
Hmm, this is set up to respond to this syntax  works:
I kept this consistent with percentage scaling, which responds to [image|300x100,50%].
1 Mi Piace
TallTed
(Ted Thibodeau Jr)
21 Febbraio 2019, 4:26pm
14
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 Mi Piace
snsnjsn
(Jianwei Li)
26 Ottobre 2019, 6:34am
15
the same question i want to ,just tell picture ,it is 200px width ,and skip height
jord8on
(Jordan)
6 Febbraio 2020, 1:09am
16
Vorrei avere anche questa possibilità.
Per ricapitolare, sembra che la sintassi attuale per ridimensionare le immagini (con spazi per migliorare la leggibilità) sia:
! [ NOME_IMMAGINE | LARGHEZZAxALTEZZA, PERCENTUALE_SCALA ] ( POSIZIONE_IMMAGINE )
Credo che sarebbe davvero ottimo se potessimo ridimensionare SOLO la larghezza OPPURE l’altezza, inserendo la parola AUTO per la rispettiva dimensione.
Ad esempio: diciamo che vorrei che questa immagine avesse una larghezza di 150px, ma non voglio calcolare il rapporto per regolare l’altezza alla risoluzione corretta…

Mi piacerebbe molto se potessimo sostituire la LARGHEZZA con 150 e l’ALTEZZA con auto come segue…

Pareri @Falco ?
sam
(Sam Saffron)
6 Febbraio 2020, 1:19am
17
Ritengo ancora che la proposta originale sia un po’ più facile da spiegare.
Incolla:

Poi modifica in:

Funziona già ora in questo modo, ma è un po’ più difficile da spiegare:

@jord8on tutto questo funziona già, questa è la sintassi che stai cercando:
[very good|250x190,150x]
4 Mi Piace
jord8on
(Jordan)
6 Febbraio 2020, 2:31am
18
Ahhhhh @sam , grazie per il reindirizzamento. La funzionalità attuale è PERFETTA, se ho capito bene ora.
Vediamo se ho capito correttamente…
“x” rappresenta “auto”
se uso “x” prima del numero, rappresenta la larghezza. Es. x150 = "width: auto; height: 150px;"
se uso “x” dopo un numero, rappresenta l’altezza. Es. 150x = "width: 150px; height: auto;"
––––––––––––––––––––––––––––––––––––
Proviamo con questa immagine che ha "width:600px; height: 200px;"
La sintassi di incorporamento predefinita è:

che appare così…
La seguente immagine è stata ridimensionata a una larghezza di 200px (altezza = x = auto):

che appare così:
La seguente immagine è stata ridimensionata a un’altezza di 100px (larghezza = x = auto):

che appare così:
––––––––––––––––––––––––––––––––––––
Sembra che funzioni alla perfezione. Sono così felice di aver capito e ora di poterlo usare!
Grazie @sam per la rapida risposta!
9 Mi Piace