Dear anyone,
Your duolingo forum registration isn't automaticaly transferred to duome forum so in order to join duome forums you need to register with your existing or any other username and email; in any case it's advised that you choose a new password for the forum.
~ Duome Team

[GUIDE] How to Resize images

These Duome Forum guides have step-by-step instructions and screenshots on how to achieve the desired results. So read the relevant ones before you ask again.


User avatar
justheaven

[GUIDE] How to Resize images

Post by justheaven »

(BB - moved to How-to Guides) (renamed to How to Resize Images)

I've found this thread on Resize image BBcode: https://www.phpbb.com/community/viewtopic.php?t=2571406

But the [img width=x]img url[/img] code is not working here.

Something like this could be very useful, especially with big images or screenshots, or just to customize our posts better. (Or maybe it already exists it's just I don't know how to apply it. Please let me know if that's the case.)



Thank you all who work so hard to make this forum look amazing!

N🇧🇬 A2:es: C1:us:
"That youngster's naturalness is impressive."Duolingo

User avatar
duome

Re: Image resize option?

Post by duome »

I added an [image=100,100]{URL}[/image] BBCode where you have to specify actual or rather desired dimensions instead of 100x100 (in pixels), but you have to keep the original proportions in mind.

User avatar
Basler Biker
Switzerland

Re: Image resize option?

Post by Basler Biker »

duome wrote: Tue Mar 29, 2022 6:28 pm

I added an [image=100,100]{URL}[/image] BBCode where you have to specify actual or rather desired dimensions instead of 100x100 (in pixels), but you have to keep the original proportions in mind.

==> The curly braces (accolade) are just for the "notation" - don't put them ;-) and it works
Get a finger, want the whole hand...can there be only 1 parameter for proportional resizing in % of original ???
(then we go to sleep...)

GR!PS ARD-alpha


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
luo-ning

Re: Image resize option?

Post by luo-ning »

Might be better to "overload" the existing [img] BBCode with optional size parameters, rather than adding a new BBCode [image] — keeps things simpler and easier to remember.

🦀 Pensando en la inmortalidad del cangrejo 🏴‍☠️ Flags Are Not Languages

User avatar
Basler Biker
Switzerland

Re: Image resize option?

Post by Basler Biker »

luo-ning wrote: Tue Mar 29, 2022 7:35 pm

Might be better to "overload" the existing [img] BBCode with optional size parameters, rather than adding a new BBCode [image] — keeps things simpler and easier to remember.

everything step-by-step and going steady luo-ning ;-)


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
justheaven

Re: Image resize option?

Post by justheaven »

duome wrote: Tue Mar 29, 2022 6:28 pm

I added an [image=100,100]{URL}[/image] BBCode where you have to specify actual or rather desired dimensions instead of 100x100 (in pixels), but you have to keep the original proportions in mind.

Awesome!! Let me try it :geek:

original (100,100):
Image

resized small (30,30):

resized bigger (250,250)

screenshot (1096,684) resized to (796,384)

Ok that looks a little wonky.

Question: What proportions to put on images with weird dimensions (like the one above) so that they don't look distorted? (Or rather how to calculate the proportions for resizing) :?: (aka I'm bad at math, help!)

N🇧🇬 A2:es: C1:us:
"That youngster's naturalness is impressive."Duolingo

User avatar
luo-ning

Re: Image resize option?

Post by luo-ning »

Basler Biker wrote: Tue Mar 29, 2022 7:50 pm
luo-ning wrote: Tue Mar 29, 2022 7:35 pm

Might be better to "overload" the existing [img] BBCode with optional size parameters, rather than adding a new BBCode [image] — keeps things simpler and easier to remember.

everything step-by-step and going steady luo-ning ;-)

On investigation, it seems "overloading" isn't easily doable without making changes to the core source code, which isn't really worth it, so [image] will have to do for now 😅

🦀 Pensando en la inmortalidad del cangrejo 🏴‍☠️ Flags Are Not Languages

User avatar
Basler Biker
Switzerland

Re: Image resize option?

Post by Basler Biker »

justheaven wrote: Tue Mar 29, 2022 10:54 pm
duome wrote: Tue Mar 29, 2022 6:28 pm

I added an [image=100,100]{URL}[/image] BBCode where you have to specify actual or rather desired dimensions instead of 100x100 (in pixels), but you have to keep the original proportions in mind.

Awesome!! Let me try it :geek:

original (100,100):
Image

resized small (30,30):

resized bigger (250,250)

screenshot (1096,684) resized to (796,384)

Ok that looks a little wonky.

Question: What proportions to put on images with weird dimensions (like the one above) so that they don't look distorted? (Or rather how to calculate the proportions for resizing) :?: (aka I'm bad at math, help!)

to keep the proportions without calculating

  • open de picture in IrfanView
  • CTRL-R "resize" - Check "keep aspect ratio" - unit = pixels
  • change one size in pixels, such as width, => the height will adapt.
  • use width and height to resize here in duome

;-)


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
justheaven

Re: Image resize option?

Post by justheaven »

Oh, that was so easy! Because for a moment there I truly felt like this :lol:

There it is, right proportions (700,436) 8-)

Thank you!

N🇧🇬 A2:es: C1:us:
"That youngster's naturalness is impressive."Duolingo

User avatar
Basler Biker
Switzerland

Re: Image resize option?

Post by Basler Biker »

Some images are not fully visible on a phone even when rotated to "landscape"/"cinema" mode ;-)

That's is when the tag [image=x,y] is used. It specifies a fixed size in pixels, and the image won't adapt to phone/screen size.
Whereas with [img] the image will in all circumstances stretch/shrink to available full-screen width.

Making pictures size 300,200 will make them fully visible on a "portrait" phone, yet be shown quite small on a PC.
Making pictures size 600,400 will make them visible on a "landscape" phone.


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
luo-ning

Re: Image resize option?

Post by luo-ning »

Basler Biker wrote: Wed Apr 13, 2022 11:54 am

Some images are not fully visible on a phone even when rotated to "landscape"/"cinema" mode

That's is when the tag [image=x,y] is used. It specifies a fixed size in pixels, and the image won't adapt to phone/screen size.
Whereas with [img] the image will in all circumstances stretch/shrink to available full-screen width.

Making pictures size 300,200 will make them fully visible on a "portrait" phone, yet be shown quite small on a PC.
Making pictures size 600,400 will make them visible on a "landscape" phone.

Should be fixed now — I changed the BBCode tag HTML from this:

Code: Select all

<img style="width: {NUMBER1}px; height: {NUMBER2}px;">

To this:

Code: Select all

<div style="max-width: {NUMBER1}px; max-height: {NUMBER2}px;">
	<img style="width: 100%; height: 100%;" src="{URL}" >
</div>

🦀 Pensando en la inmortalidad del cangrejo 🏴‍☠️ Flags Are Not Languages

User avatar
Basler Biker
Switzerland

Re: Image resize option?

Post by Basler Biker »

luo-ning wrote: Wed Apr 13, 2022 6:42 pm
Basler Biker wrote: Wed Apr 13, 2022 11:54 am

Some images are not fully visible on a phone even when rotated to "landscape"/"cinema" mode

That's is when the tag [image=x,y] is used. It specifies a fixed size in pixels, and the image won't adapt to phone/screen size.
Whereas with [img] the image will in all circumstances stretch/shrink to available full-screen width.

Making pictures size 300,200 will make them fully visible on a "portrait" phone, yet be shown quite small on a PC.
Making pictures size 600,400 will make them visible on a "landscape" phone.

Should be fixed now — I changed the BBCode tag HTML from this:

Code: Select all

<img style="width: {NUMBER1}px; height: {NUMBER2}px;">

To this:

Code: Select all

<div style="max-width: {NUMBER1}px; max-height: {NUMBER2}px;">
	<img style="width: 100%; height: 100%;" src="{URL}" >
</div>

THANK YOU ... next would be ... to have a single input parameter as percentage of the original image size, so x,y are always ratio-respecting ;-) ;-) ;-)


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
luo-ning

Re: Image resize option?

Post by luo-ning »

[mention]Basler Biker[/mention] you can now specify just the 1st value (width) and it'll use the correct aspect ratio by default.

Code: Select all

[image=100]https://i.postimg.cc/1RnznV6m/screenshot-161.png[/image]

[image=200,50]https://i.postimg.cc/1RnznV6m/screenshot-161.png[/image]

Unfortunately some [image]s earlier in this thread now look broken because they got re-parsed while I was tinkering around — I think hitting "Edit" and re-saving them without making changes should be enough to fix them.

🦀 Pensando en la inmortalidad del cangrejo 🏴‍☠️ Flags Are Not Languages

User avatar
Basler Biker
Switzerland

Re: Image resize option?

Post by Basler Biker »

luo-ning wrote: Wed Apr 13, 2022 9:08 pm

@Basler Biker you can now specify just the 1st value (width) and it'll use the correct aspect ratio by default.

Code: Select all

[image=100]https://i.postimg.cc/1RnznV6m/screenshot-161.png[/image]

[image=200,50]https://i.postimg.cc/1RnznV6m/screenshot-161.png[/image]

Unfortunately some [image]s earlier in this thread now look broken because they got re-parsed while I was tinkering around — I think hitting "Edit" and re-saving them without making changes should be enough to fix them.

Génial !! but [mention]luo-ning[/mention] I am confused now...is it with IMG or the IMAGE tag?


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
luo-ning

Re: Image resize option?

Post by luo-ning »

Basler Biker wrote: Wed Apr 13, 2022 9:14 pm

Génial !! but @luo-ning I am confused now...is it with IMG or the IMAGE tag?

[img] can still be used but can't supply width/height. If you want to set width or width and height, you still have to use [image].

🦀 Pensando en la inmortalidad del cangrejo 🏴‍☠️ Flags Are Not Languages

User avatar
Basler Biker
Switzerland

Re: Image resize option?

Post by Basler Biker »

luo-ning wrote: Wed Apr 13, 2022 9:46 pm
Basler Biker wrote: Wed Apr 13, 2022 9:14 pm

Génial !! but @luo-ning I am confused now...is it with IMG or the IMAGE tag?

[img] can still be used but can't supply width/height. If you want to set width or width and height, you still have to use [image].

but then, what are the 2 parameters that you used here? Are they not sizes given in the text? I am lost...
viewtopic.php?p=12450-guide-how-to-resize-images#p12450


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
luo-ning

Re: Image resize option?

Post by luo-ning »

Basler Biker wrote: Wed Apr 13, 2022 9:58 pm

but then, what are the 2 parameters that you used here? Are they not sizes given in the text? I am lost...
viewtopic.php?p=12450-guide-how-to-resize-images#p12450

That's the rendered HTML, not the BBCode (but I actually already changed the rendered HTML since then 😅)

🦀 Pensando en la inmortalidad del cangrejo 🏴‍☠️ Flags Are Not Languages

Post Reply

Return to “Duome's How-to Guides”