Dynamic image resizing function

This may be a bit niche, but I thought I would float the idea anyway. Could we have an instruction in the script language to dynamically resize an image? A few platforms I've looked through are very strict on image dimensions, and while of course it's possible to resize project images beforehand and put them in a different directory, it would be easier to be able to use whatever existing images we use and resize them on the fly.
I envisage something like this:
I envisage something like this:
[Profile_Image]
type=file
must be filled=1
hint=Choose an image for your profile (also called avatar). It does not (and also should not) have to show you on the picture but something that represents you.
default=general_profile.png
allow html=0
filter=Image files|*.jpg;*.jpeg;*.png;*.gif|PNG|*.png|GIF|*.gif|Jpeg|*.jpg;*.jpeg
resize=120x120
resize=120x120
Comments
This was using a spinfolder macro if that may have any effect.