05-15-2004, 03:22 PM
· #1 Senior Member
Join Date: May 2003
Posts: 2,211
NP$: 6170.25 (
Donate )
whos good at maths?
hey
i suck at maths big time and i got a problem
im making a image script for someone
if an image is wider than 700px the hole page distorts and looks crap
i can set the width and the height of the image easily but if i set the image width to 700 it looks like its been stretched because of the height
so what i need to do is to find out a ratio/scale/%age of the height to the width so the image wont look distored or stretched
and then im going to provide a link to the full size image...
anyone got any ideas?
thanks
adam
05-15-2004, 03:27 PM
· #2 So easy a Domainer can ..
Join Date: Mar 2004
Posts: 9,386
NP$: 1304.35 (
Donate )
Eg :
468 H
60 H
468 / 60 = 7.8
So your W should remain 7.8 times your H -
You'll need Both Actual Dimensions W = Width H = Height
Does this help ?
__________________
Nothing to see here ... Move Along. Nights in White Satin I dare you to find a better version - And this one is almost 40 years after the fact.
05-15-2004, 03:28 PM
· #3 DomainsForCharity™ Person
Name: Jason
Location: Naperville Illinois
Join Date: Jun 2003
Posts: 1,803
NP$: 493.50 (
Donate )
yeah i know what to do. Lets say your max width is 300 px and somebody submits an image that is 600 px wide and 200 px high.
newWidth = maxWidth
newHeight = (maxWidth * originalHeight) / originalWidth
That should keep the images scaled
__________________
Quote: Clan-Forums.com >> $30 BoardingForum.com >> $100 TalkWebHosting.com >> $200 AvoidChapter13.com >> $100 Send PM to make lesser offers on the above names.
05-15-2004, 03:42 PM
· #4 Senior Member
Join Date: May 2003
Posts: 2,211
NP$: 6170.25 (
Donate )
thank you both
helped me alot
works a treat
05-15-2004, 04:13 PM
· #5 Name: Retired©
Location: NH
Join Date: May 2003
Posts: 28,000
NP$: 1641.00 (
Donate )
Nice job, folks!
__________________
Be cool. Be polite. Be professional.™ Tick. Tock. | "dot Mobey" R.I.P.
05-16-2004, 06:26 PM
· #6 Namepros Addict
Name: Alexandra
Location: Toronto
Join Date: Jun 2003
Posts: 2,414
NP$: 351.00 (
Donate )
Yay for solving problems!
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off