[Phpwm] [OT] Any ideas how to do this?
Phil Beynon
phil at infolinkelectronics.co.uk
Fri May 26 11:18:22 BST 2006
> > Cheers Greg,
> > That's actually very near what I wanted indeed. Is there a way
> of making
> > it work both ways text1 -> text2 as now and also text2 -> text1
> onchange?
> >
> > Couple of oddities on it though that I noticed -
> > On the default starting value of 300/200 if you put a leading zero in
> > front of the 300 then the 200 drops to 128 for some reason.
> >
> > If there is no content in text1 text2 says "NaN" for some reason!
>
> http://www.phpwm.org/pastebin/index.php?id=50
>
> has a couple of changes:
> both boxes now trigger the effect, and the error-handling is a little
> better.
> I might have been a little over-zealous in my use of parseInt, as I
> noticed some odd roundings, so might want to try with parseFloat
> in place
> of at least some of them.
>
> Greg
Hi Greg,
Cheers - I owe you a pint at the next users group meeting!
I'm much better at server side scripting, just never really got it together properly with client side browser manipulation stuff. I can tweak and modify existing javascript quite well and sometimes get things going from scratch but had really no idea on this one!
I'll give it a good bashing about later today and make such thay the numbers it gives relate to the image resize / mogrify results with Imagemagick and tweak as required. It should be just about the last bit of that page in my CMS then, its a facility to allow users to upload and resize images either as a set of pre-sized or one user defined sized image on the fly for inclusion into pages on the site.
The idea of preserving the aspect ratio on resize is quite important as it's designed to be used by totally non-technical users! :-)
Thanks again!
Phil
More information about the Phpwm
mailing list